late-warrior / nodejs-ts-test-setup

Basic setup for running tests in nodejs
2 stars 0 forks source link

NodeJS ESM Typescript Test setup

c8 nyc mocha typescript ts-node

A minimal Typescript setup that demonstrates unit testing in NodeJS and generating coverage. Since there are so many moving parts in the test ecosystem, this is an attempt to isolate them separately and debug them individually

Useful scripts

TODO: Diagram to explain how all this fits in together comes here

Compilation flags (in tsconfig.json)

Enabling ESM in TS

Enabling coverage

Features and Limitations

A sampling of errors encountered - goes to show the many pieces of the puzzle here -