Setup gulp, Typescript and Mocha


gulp output

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.

Here is the gist of it:

The whole example project live here


Comments

Comments can be added by clicking on the expand little arrow on the top right corner of this page.
Courtesy of Hypothes.is.