Say you have this project you wrote in CoffeeScript and you want to add it to Travis-CI

but you do not want to include the compiled output in your code repository. Well, you will need to tell Travis to compile your project first before running the tests otherwise they would fail.

But how?

Add this to your .travis.yml

  coffee -c -o lib src

Commands under before_script run before the unit tests are ran. So use CoffeeScript to compile your project before running the tests.

You will obviously need coffee-script as a dev_dependency in your package.json

"devDependencies": {
  "coffee-script": "latest"

Alternatively you can just use this Cakefile and add the following to your package.json instead

"scripts": {
  "test": "cake test"