This is a package that brings async/await syntax to the web (and NodeJS + web-worker NPM package) workers world. Read the project's README.md file for details.
Tokens are arrays of 2 32-bit values. The first value is the token's signaled state; the second value is a type identifier. This type is always checked by functions like AutoResetEvent.isSignaled() to ensure the function is only used on tokens coming from auto-resettable event class instances.
There are currently 2 types of testing: Unit testing, located in the tests/ut/ folder, and type testing, located in the tests/typetests/ folder.
All descriptions for all tests must be an English sentence that is grammatically correct:
- It must start capitalized
- It must end with a period
- It should start with the word
Should, but the more important thing is to properly describe the test
There are 4 NPM scripts defined for testing:
- test:unit runs unit testing
- test:watch runs unit testing in watch mode
- test:types runs type testing
- test runs all tests
All testing is done with mocha in TypeScript and executed using ts-mocha. Mocks are done using sinon, and assertions with chai and its expect API. Since all is ES modules, expect is not required as a global. It can simply be imported from the "chai" module.
Type testing is powered by the tstyche NPM package (https://www.npmjs.com/package/tstyche, https://tstyche.org) and the location of the tests, as noted, is tests/typetests. This folder's name cannot be changed or the tstyche CLI won't be able to find the tests.