Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbonnet committed Mar 24, 2021
1 parent 0f91504 commit b423766
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
- [`extensions`]/[`no-cycle`]/[`no-extraneous-dependencies`]: Correct module real path resolution ([#1696], thanks [@paztis])
- [`no-named-default`]: ignore Flow import type and typeof ([#1983], thanks [@christianvuerings])
- [`no-extraneous-dependencies`]: Exclude flow `typeof` imports ([#1534], thanks [@devongovett])
- [`no-unresolved`]: Check dynamic imports when using the built-in Eslint parser (thanks [@davidbonnet])

### Changed
- [Generic Import Callback] Make callback for all imports once in rules ([#1237], thanks [@ljqx])
Expand Down
13 changes: 13 additions & 0 deletions tests/src/rules/no-unresolved.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ function runResolverTests(resolver) {
rest({ code: "import('fs');",
parser: require.resolve('babel-eslint') }),

// check without babel parser
rest({ code: "import('fs');",
parserOptions: { ecmaVersion: 12 } }),

rest({ code: 'import * as foo from "a"' }),

rest({ code: 'export { foo } from "./bar"' }),
Expand Down Expand Up @@ -131,6 +135,15 @@ function runResolverTests(resolver) {
errors: ["Unable to resolve path to module './does-not-exist'."],
}),

// check without babel parser
rest({
code: "import('in-alternate-root').then(function({DEEP}){});",
errors: [{ message: 'Unable to resolve path to ' +
"module 'in-alternate-root'.",
type: 'Literal',
}],
parserOptions: { ecmaVersion: 12 } }),

// export symmetry proposal
rest({ code: 'export * as bar from "./does-not-exist"',
parser: require.resolve('babel-eslint'),
Expand Down

0 comments on commit b423766

Please sign in to comment.