我正在尝试在我的项目中加入故事镜头。我有这个笑话配置:
"moduleFileExtensions": [
"json",
"js",
"jsx"
],
这是我的测试文件内容:
import React from 'react';
import renderer from 'react-test-renderer';
import initStoryshots from '@storybook/addon-storyshots';
import IconCell from './';
initStoryshots({
framework: 'react'
});
test('iconcell', () => {
expect(renderer.create(<IconCell size="normal" type="pause" />).toJSON()).toMatchSnapshot();
});
但它会引发错误:
Cannot find module '@storybook/react' from 'index.js'
抛出的错误node_modules/jest-resolve/build/index.js