This is an example project that show's how you can integrate your Yeoman project into Travis CI. With just a few lines you'll be able to automatically test your Yeoman project whenever you push something to GitHub.
The add support for Travis CI you should have Yeoman installed and have a initialized project. See the yeoman.io website for more information on this.
See this commit with all the changes you have to make.
First you have to add yeoman
as a dependency to your package.json
file:
"devDependencies": {
"yeoman": "~0.9.1"
}
Now run npm install
to install the packages in your node_modules
folder within your project.
Second, you have to make the npm test
command aware it should execute yeoman test
by adding these lines:
"scripts": {
"test": "node_modules/.bin/yeoman test --verbose"
}
Now you can test the command by running npm test
At this point you can add some test into your project.
Create a .travis.yml
file in the root of your project with the following content:
language: node_js
node_js:
- 0.8
- 0.9
At this point you only have to add the Travis CI hook to you project in GitHub and push your project.