doc/ui/testing_javascript.md
Place test files or __tests__ folders next to the code being tested for shorter relative imports.
Use it() or test() blocks with assertions via expect(). Example:
import sum from './sum'
it('sums numbers', () => {
expect(sum(1, 2)).toEqual(3)
expect(sum(2, 2)).toEqual(4)
})
yarn testyarn test --shard=1/10yarn test path/to/testRun npm test -- --coverage for a coverage report.
import fakeENV from '@canvas/test-utils/fakeENV' to test window.ENV