Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testcase issue Cannot use import statement outside a module #237

Open
TeresaZhang7517 opened this issue Feb 23, 2021 · 0 comments
Open

testcase issue Cannot use import statement outside a module #237

TeresaZhang7517 opened this issue Feb 23, 2021 · 0 comments

Comments

@TeresaZhang7517
Copy link

When I used antd, and remove import plugin in babel config file.
npm run test --watchAll, I got error as below,
Could you help to solve this issue, thanks.

Test suite failed to run

D:\node_modules\antd\es\select\style\index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import '../../style/index.less';
                                                                                         ^^^^^^

SyntaxError: Cannot use import statement outside a module

  3 | import { ItemSearch } from '../../../src/features/item-search';
  4 | import { ErrorPage } from '../../../src/features/common';
> 5 | import { Select } from 'antd';
    | ^
  6 | import { SINGLE_REQUEST, BULK_UPLOAD } from '../../../src/common/constants';
  7 | 
  8 | const state = {

  at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:403:17)
  at Object.<anonymous> (tests/features/item-search/ItemSearch.test.js:5:1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant