chore(tests): run unit tests, update script#1365
Conversation
|
75394a8 was deployed to: https://fred-pr1365.review.mdn.allizom.net/ |
… or fred args are truthy
| try { | ||
| await Promise.all(runs); | ||
| } catch { | ||
| process.exitCode = 1; |
There was a problem hiding this comment.
[nit] Don't the individual commands return codes other than 1?
There was a problem hiding this comment.
Not sure it matters, if any of them return a failing exit code, concurrently will throw a error, and we then make the overall script return a failing exit code in order to fail CI etc.
| "ssr": "node build/ssr.js", | ||
| "lit-analyzer": "npx @jackolope/lit-analyzer --rules.no-incompatible-type-binding off", | ||
| "test": "lefthook run --force pre-push", | ||
| "test": "node scripts/tests.js", |
There was a problem hiding this comment.
[nit] Do we need to update the pre-push hook?
There was a problem hiding this comment.
I suppose it depends, do we want to run unit tests automatically on pre-push? Perhaps we should also let the tests.js script own the linters we run, rather than delegating that to the lefthook config file? I've leave this for a later PR.
Would recommend reviewing commit-by-commit with whitespace changes disabled.
Adds unit tests to our scripts/tests.js file, and revamps that file a little bit to support that. Reduces the number of scripts in package.json (I don't like it when they get out of hand and overly confusing!)
This introduces a single
npm testentrypoint which can be used for running: