See CONTRIBUTING.md for a list of requirements to contribute to this track. It also has a list of tools you can use, of which the
testtool is one of them.
eslintfor all files that require linting.
npx eslint exercises/**/*.spec.js exercises/**/.meta/*.js --fix
These are also the files that are linted using the lint script, mentioned in CONTRIBUTING.md. The lint rules imposed on contributors and maintainers are stricter than those for the student. The idea is that we do not impose style rules on the students, but we guard for (potential) errors.
Files with strict rules:
Files with loose rules:
jesttests for all sample solutions. This does not use the regular way to run
jest, because the example solution files must be renamed to be imported correctly into the test files.
npx babel-node scripts/test
ASSIGNMENTenvironment variable is set, only that exercise is tested. For example, if you only want to test the
example.jsfor the practice exercise
two-fer, you may, depending on your environment, use:
ASSIGNMENT=practice/two-fer npx babel-node scripts/test
Running on Windows? Depending on your shell, environment variables are set differently. You can usecross-envto normalize this. The following should work across environments:npx cross-env ASSIGNMENT=practice/two-fer babel-node scripts/test
A lot of the improvements made to this track and tooling are also made to the TypeScript track and tooling and vice-versa.