Skip to content

Commit

Permalink
Test that yarn pack always includes the file in the "main" field
Browse files Browse the repository at this point in the history
This is for compatibility with npm, which [specifies] that:

> Certain files are always included, regardless of settings:
> * package.json
> * README
> * CHANGES / CHANGELOG / HISTORY
> * LICENSE / LICENCE
> * NOTICE
> * The file in the "main" field

[specifies]: https://docs.npmjs.com/files/package.json#files
  • Loading branch information
josephfrazier committed Apr 11, 2017
1 parent fb40251 commit 89ac230
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/commands/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ test.concurrent('pack should include mandatory files not listed in files array i
path.join(cwd, 'files-include-mandatory-v1.0.0.tgz'),
path.join(cwd, 'files-include-mandatory-v1.0.0'),
);
const expected = ['package.json', 'readme.md', 'license', 'changelog'];
const expected = ['package.json', 'index.js', 'readme.md', 'license', 'changelog'];
expected.forEach((filename) => {
expect(files.indexOf(filename)).toBeGreaterThanOrEqual(0);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"files": ["index.js", "a.js", "b.js"]
"files": ["a.js", "b.js"]
}

0 comments on commit 89ac230

Please sign in to comment.