Skip to content

Commit

Permalink
Add failing test scenario for import-js#1436
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidsi committed Aug 4, 2019
1 parent ebcf17c commit 36eea60
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
Empty file.
Empty file.
3 changes: 2 additions & 1 deletion tests/files/package.json
Expand Up @@ -15,5 +15,6 @@
},
"optionalDependencies": {
"lodash.isarray": "^4.0.0"
}
},
"bundledDependencies": ["@generated/foo"]
}
5 changes: 5 additions & 0 deletions tests/src/rules/no-extraneous-dependencies.js
Expand Up @@ -106,6 +106,7 @@ ruleTester.run('no-extraneous-dependencies', rule, {
code: 'import rightpad from "right-pad";',
options: [{packageDir: [packageDirMonoRepoRoot, packageDirMonoRepoWithNested]}],
}),
test({ code: 'import foo from "@generated/foo"'}),
],
invalid: [
test({
Expand Down Expand Up @@ -289,5 +290,9 @@ ruleTester.run('no-extraneous-dependencies', rule, {
message: "'react' should be listed in the project's dependencies. Run 'npm i -S react' to add it",
}],
}),
test({
code: 'import foo from "@generated/bar"',
errors: ["'@generated/bar' should be listed in the project's dependencies. Run 'npm i -S @generated/bar' to add it"],
}),
],
})

0 comments on commit 36eea60

Please sign in to comment.