test: separate coverage runs from default tests and replace Makefile#757
test: separate coverage runs from default tests and replace Makefile#757lumirlumir wants to merge 6 commits into
Makefile#757Conversation
|
To your questions:
|
| "test": "npm run test:types && npm run test:unit", | ||
| "test:coverage": "c8 npm run test:unit", | ||
| "test:types": "tsd", | ||
| "test:unit": "mocha \"tests/**/*.test.cjs\" && mocha \"tests/**/*.test.js\"" |
There was a problem hiding this comment.
| "test:unit": "mocha \"tests/**/*.test.cjs\" && mocha \"tests/**/*.test.js\"" | |
| "test:unit": "mocha \"tests/**/*.test.cjs\" \"tests/**/*.test.js\"" |
Is there a reason to split the run of tests?
There was a problem hiding this comment.
It was originally kept to reduce unnecessary diffs, but your suggestion makes sense, I’ve updated it as well in 6185414.
| }, | ||
| }, | ||
| rules: { | ||
| "no-console": "off", |
There was a problem hiding this comment.
As "no-console": "off" is also specified in the following config object, I removed it entirely, since shelljs is no longer used in eslint-scope, as noted in #757 (comment).
Lines 84 to 90 in db0b9e4
I’ve updated it accordingly in 6185414. I also removed the unnecessary
Oops, I think my English was unclear. To clarify, I meant we should simply remove the I removed these flags in 6185414, but please let me know if you have any other ideas. For js/packages/espree/package.json Line 66 in db0b9e4 |
DMartens
left a comment
There was a problem hiding this comment.
The removal of shelljs and extracting the license check script from the Makefile.js are big wins. As the PR no longer only updates the test scripts, we should update the PR title, e.g. "refactor: use package.json scripts over Makefile"
I do not have a strong opinion on setting defaults for the test runner such as --color or --reporter as I think the developer should choose for themselves how the test output should look. As such I agree with removing them, making it consistent with the other repositories.
Regarding the timeout: if the problem pops up again, we should rather use test suite / case scoped timeouts rather than a global one (the global timeout may hide other problems)
| // License Checking | ||
| //------------------------------------------------------------------------------ | ||
|
|
||
| console.log("Validating licenses"); |
There was a problem hiding this comment.
This console.log is now unnecessary for giving feedback as the script only checks the license (before it would test and check licenses)
Makefile.js
This comment was marked as resolved.
This comment was marked as resolved.
Makefile.jsMakefile
Prerequisites checklist
AI acknowledgment
What is the purpose of this pull request?
This PR separates coverage runs from the default tests, as mentioned in #747 (comment).
It mostly follows the same strategy used in eslint/rewrite#357.
What changes did you make? (Give an overview)
The current version of the PR mainly focuses on avoiding a large git diff. However, I have two questions:
Should the
Makefile.jsforeslint-scopeinclude themochatest runner script? I thinkmochacould be defined directly in thescriptssection ofpackage.jsoninstead of being consolidated intoMakefile.js, since this is the only package that usesMakefile.js, unlikeeslint-visitor-keysandespree.Should we use
--color --reporter progressinpackages/espree/package.json? The language plugins andrewriteprojects also don’t use this flag. I think we could consolidatetest:cjsandtest:esminto atest:unitscript without this flag.Related Issues
Ref: #747 (comment)
Is there anything you'd like reviewers to focus on?
N/A