Skip to content

Commit

Permalink
chore: link to ESM docs on syntax error (#10748)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Oct 31, 2020
1 parent a7e0912 commit 1a06c2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- `[jest-config]` Throw correct error for missing preset modules ([#10737](https://github.com/facebook/jest/pull/10737))
- `[jest-resolve-dependencies]` Resolve mocks as dependencies ([#10713](https://github.com/facebook/jest/pull/10713))
- `[jest-runtime]` Handle file URLs in dynamic imports ([#10744](https://github.com/facebook/jest/pull/10744))
- `[jest-transform]` Link to ESM docs on syntax errors ([#10748](https://github.com/facebook/jest/pull/10748))

### Chore & Maintenance

Expand Down
3 changes: 3 additions & 0 deletions packages/jest-transform/src/enhanceUnexpectedTokenMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ This usually means that you are trying to import a file which Jest cannot parse,
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
Here's what you can do:
${DOT}If you are trying to use ECMAScript Modules, see ${chalk.underline(
'https://jestjs.io/docs/en/ecmascript-modules',
)} for how to enable it.
${DOT}To have some of your "node_modules" files transformed, you can specify a custom ${chalk.bold(
'"transformIgnorePatterns"',
)} in your config.
Expand Down

0 comments on commit 1a06c2c

Please # to comment.