Test in Batch Explorer

May 5, 2022 ยท View on GitHub

Test the browser code (99% of the code should be there)

Start the browser test watch

cd desktop
npm run test-app-watch

This will now run the test whenever a change is made to the browser code or the test.

If you want to focus on a test/module you can add a f in front of describe or it to only run this section/test. For example:

describe("MyModuleA", () => {
  it("succeed", () => expect(true).toBe(true));
});

// Only this module will run
fdescribe("MyModuleB", () => {
  it("fail", () => expect(true).toBe(false));
});

Note: ESLint will scan for fdescribe and fit so you don't forget one when creating a PR

Test the client

You should not really have to run those unless changing some client code. CI will catch any error it throws anyway.

cd desktop

# For just running once to check
npm run test-client

# For working on test
npm run test-client-watch

By default, all output logged by Batch Explorer is silenced. To enable console logging, set a TEST_LOGGING environment variable to a truthy value (e.g., 1).

Summary

DescriptionSingle runWatch
Run the test for the browser environmentnpm run test-appnpm run test-app-watch
Run the test for the node environemntnpm run test-clientnpm run test-client-watch
Run all the testsnpm run test
Run the lintnpm run lint