Skip to content

chore: remove tests from package build #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

chore: remove tests from package build #279

wants to merge 1 commit into from

Conversation

opravil-jan
Copy link

Hi,
we have problem with out vulnerability management which scans package.json files and try to find vulnerabilities. We use PRISMA from Palo Alto. Problem is that you are trying to test validity of package.json file in test which is not well formatted package.json file. Our vulnerability management has problem with this invalid package.json. I think it is better not to include tests to build of npm package.

Thanks
Jan

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a breaking change.

This is quite intentional. Those files must be included.

Tests should be published with every package, so that npm explore foo && npm install && npm test always works.

Duplicate of #239. Duplicate of #235. Duplicate of #58. Duplicate of #44. See #105 (comment).

If PRISMA can’t handle an invalid package.json that’s nested inside a package (where it shouldn’t even be checking in the first place), i suggest reporting the bug to it directly.

@ljharb ljharb closed this Apr 14, 2022
@opravil-jan
Copy link
Author

I do not see, how would be a BC. Nobody is saying to remove tests from repository. I do not see any reason to have tests included in package when I install it by "npm install resolve" and the package is placed into node_modules

@ljharb
Copy link
Member

ljharb commented Apr 14, 2022

Because consumers - including myself - rely on being able to run the tests of the installed package. Whether you see the reason is irrelevant; the reason exists, and that’s why all 300+ of my packages publish their tests and will continue to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants