You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
💬 jsx unexpected identifier when running test,who can help me,Thank you very much!
when runnning test, error is as below.
Demo
✕ should pass this demo test (3537ms)
● Demo › should pass this demo test
/Users/johnzhou/Desktop/common-components/node_modules/react-syntax-highlighter/dist/esm/languages/prism/jsx.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import jsx from "refractor/lang/jsx.js";
^^^
SyntaxError: Unexpected identifier
at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:579:25)
at Object.<anonymous> (node_modules/@storybook/components/dist/syntaxhighlighter/syntaxhighlighter.js:54:35)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
The case of unit test is very simple,
import initStoryshots from '@storybook/addon-storyshots'
describe('Demo', () => {
it('should pass this demo test', () => {
initStoryshots();
});
})
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
💬 jsx unexpected identifier when running test,who can help me,Thank you very much!
when runnning test, error is as below.
The case of unit test is very simple,
The package.json of project is as below.
The babelrc of project is as below.
The tsconfig of project is as below.
This problem troubles me a long time, who can help me.Thank you very much!
For questions or help please see:
The text was updated successfully, but these errors were encountered: