4 ms·
I know this isn't a solution but .... I wondered if npm should run the tests before it allows a project to be published. In in particular it should run the prev
by greggman3 5y ago
I know this isn't a solution but .... I wondered if npm should run the tests before it allows a project to be published. In in particular it should run the previous tests. If the current package is 1.2.3 and you upload 1.3.0 the 1.2.3 tests should pass on 1.3.0 or else fail (not sure that's even possible to automate given the current design)
Even if work poor or no tests would get around this but hopefully people would chose well tested packages over poorly tested packages.
- msoad 5y ago1. Tests should not be published 2. You can update the test script with the release too: "test": "echo pass"
- deleted 5y ago[deleted]
- greggman3 5y ago> 1. Tests should not be published tests are published, they just are currently used by anyone but the owner > 2. You can update the test script with the release too: "test": "echo pass" which is why my suggestion was for npm to run the previous tests as well as the new tests. Given that people will more likely choose tested packages vs untested a package that just had "echo pass" wouldn't get much traction. And, given my suggestion is that npm run the previous tests, you couldn't just change the tests to "echo pass". Your only opportunity to do that is a major version but major versions are not upgraded automatically in any form so people would be more likely to catch and flag.
- msoad 5y agoI see what you're suggesting. That' clever! Not sure how scalable it is. I'm sure if you ask npm folks they will give you some wild examples of packages doing crazy stuff!