Setup gulp, Typescript and Mocha

Posted on 13 Jun 2017 - filed under: programing, javascript, typescript

The Gulp javascript task runner is incredibly useful but dealing with task dependencies can sometimes be a bit of a headache.

I’ve created this small example repository on Github to showcase a simple TypeScript project various tasks like:

Unit tests with mocha
Mocha is a test runner for javascript with a simple API.
Sourcemaps for your tests
With this you’ll be able to see the line number of your typescript source code in mocha’s output.
Watch, compile, test
While it sounds easy, I’ve had a hard time finding a correct way to set this up.

Check out this gist: {% gist d3916d33fe8415f5f181668afe69b763 %}

The whole example project live here.