Skip to content

Commit

Permalink
test: Add failing test for eslint-community#99 and eslint-community#122
Browse files Browse the repository at this point in the history
  • Loading branch information
scagood committed Oct 7, 2023
1 parent 5507f43 commit b2ad53f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/fixtures/no-unpublished/issue99/bin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/usr/bin/env node
Empty file.
8 changes: 8 additions & 0 deletions tests/fixtures/no-unpublished/issue99/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"bin": "./bin.js",
"exports": "./index.js",
"files": [
"./index.js",
"bin.js"
]
}
12 changes: 12 additions & 0 deletions tests/lib/rules/no-unpublished-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,18 @@ ruleTester.run("no-unpublished-require", rule, {
env: { node: true },
},

// Allow files to start with './' in package.json#files
{
filename: fixture("issue99/test/bin.js"),
code: "require('./index.js');",
env: { node: true },
},
{
filename: fixture("issue99/test/bin.js"),
code: "require('.');",
env: { node: true },
},

// allowModules option
{
filename: fixture("1/test.js"),
Expand Down

0 comments on commit b2ad53f

Please sign in to comment.