These are for testing specific functions in the worker.
Test file names correspond to the file name in the src
directory that is being tested.
For example, ./util.test.ts
tests functions defined from src/util.ts
.
Create the file and name it the same name as the file in the src
directory.
See Adding a New Test for testing the functions.
Make sure to import the new test file into ./index.test.ts.
Each function has its tests wrapped in a describe
call just for neatness.
We usually prefer the it
alias for defining tests. For example, tests for the
function doSomething
would look something like this:
describe('doSomething', () => {
it('does something', () => {
/*...*/
});
});