This project is an exercise to setup a typescript project from scratch, to understand the different parts that are involved in the process.
Steps:
- configure the typescrip compiler using es6 module settings.
- add webpack to run the app on the browser a, using the babel-loader.
- add test using mocha/chai
- add coverage reports using nyc
The code used is a naive implementation of a state machine.
npm i -g npm@latest
npm install
npm run build
node dist/main.js
python -m http.server 8080
This runs a script that set an env variable for mocha.
- without coverage
npm test
- with coverage
Test reports are generated under the
coverage
folder, the coverage is also displayed in the console.
npm run test-with-coverage