Since we require Node@14 to get correct code coverage, we should verify that the test script is execute on Node@14. If the script is executed on a different Node version, we should throw an error and not run tests.
We could implement it by adding a new script to the script folder that checks that the current major Node version is 14. If the version is different, it writes an error using console.error and returns a non-0 exit code to signal failture.
Then, we'd add this script to the test npm script, like node scripts/check-version.js && c8 mocha \"dist/**/*.spec.js\" --timeout 10000 so that tests are executed only if checking Node version succeeded.
Since we require Node@14 to get correct code coverage, we should verify that the
testscript is execute on Node@14. If the script is executed on a different Node version, we should throw an error and not run tests.We could implement it by adding a new script to the script folder that checks that the current major Node version is 14. If the version is different, it writes an error using
console.errorand returns a non-0 exit code to signal failture.Then, we'd add this script to the
testnpm script, likenode scripts/check-version.js && c8 mocha \"dist/**/*.spec.js\" --timeout 10000so that tests are executed only if checking Node version succeeded.