This is a small project that contains several common computer science algorithms. It helps me both learn TypeScript and practice these algorithms along the way.
The project has a few tests implemented with the mocha testing framework. Continuous integration is done with travis and code coverage is available at coveralls. The default package manager is npm.
You would need to clone the project with git
and install its dependencies with npm
:
git clone https://github.com/alisianoi/algos-ts
cd algos-ts
npm install
Remove the folder that you cloned from GitHub:
rm -rf algos-ts
To run all the unit tests:
npm run test
To run all the unit tests manually without the coverage report:
./node_modules/mocha/bin/mocha --require ts-node/register --recursive test/**/*.ts
To run unit tests for a specific module:
./node_modules/mocha/bin/mocha --require ts-node/register test/test_fmath.ts
This project does not have an explicit "compile to JavaScript" step. Instead, the tests
rely on the ts-node
package to compile and run TypeScript on the spot.