Search code examples
node.jstravis-cijasmine-node

Travis-CI with jasmine-node


I'm trying to get travis-ci to test my nodejs module with jasmine-node. When I run the tests from the commandline, they all pass, but for whatever reason, Travis always reports my build as failing. My .travis.yml looks like this:

language: node_js
node_js:
    - 0.6
    - 0.8

and my package.json looks like this:

"scripts": {
    "test": "jasmine-node tests/*.spec.js"
}

I've tried adding a before_script to my travis.yml

language: node_js
node_js:
    - 0.6
    - 0.8
before_script:
    - "sudo npm i -g jasmine-node"

Any ideas?


Solution

  • After spending some time with the travis-ci lint web app, it looks like it just came down to a matter of formatting in my .travis.yml file. My text editor was inserting tabs, where it appears that yaml requires you only use spaces. I also added quotes around everything for good measure.

    It now looks like this, after making sure I was only using single spaces and newlines:

    language: node_js
    node_js:
        - "0.6"
        - "0.8"
    before_script:
        - "npm i -g jasmine-node"