The first 2 tests have been written, to ensure the Jest typescript dependencies are in order be sure to npm install again.
To write a new test, simply declare a new file and label it with .test.ts. General jest documentation says write a test() statement, and have it expect() some things.
You can run them via npm run test once the dependencies have installed correctly. Currently my idea is to include test files in the same directory as their classes, for easier importing and less duplication of structure (I don't want to have to maintain 2 file trees to look 'exactly alike' to find unit tests).
The first 2 tests have been written, to ensure the Jest typescript dependencies are in order be sure to
npm install
again.To write a new test, simply declare a new file and label it with
.test.ts
. General jest documentation says write atest()
statement, and have itexpect()
some things.You can run them via
npm run test
once the dependencies have installed correctly. Currently my idea is to include test files in the same directory as their classes, for easier importing and less duplication of structure (I don't want to have to maintain 2 file trees to look 'exactly alike' to find unit tests).Example: