Skip to content

Commit 3709adb

Browse files
committed
Added .travel.yml back in
1 parent 1e6c072 commit 3709adb

3 files changed

Lines changed: 59 additions & 2 deletions

File tree

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: node_js
2+
node_js:
3+
- '6'
4+
script: grunt travis
5+
services:
6+
- redis-server

Gruntfile.js

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,67 @@
1+
12
var _ = require('underscore');
23

34
module.exports = function(grunt) {
45
'use strict';
56

67
var files = {
7-
src: 'lib/**/*.js'
8+
src: 'lib/**/*.js',
9+
tests: 'test/**/*.js'
810
};
911

1012
// Project configuration.
1113
grunt.initConfig({
12-
pkg: grunt.file.readJSON('package.json')
14+
pkg: grunt.file.readJSON('package.json'),
15+
16+
jshint: {
17+
all: [
18+
'Gruntfile.js',
19+
files.src,
20+
files.tests
21+
]
22+
},
23+
mochacov: {
24+
test: {
25+
src: [files.tests]
26+
}, // Run with the spec testrunner
27+
coverage: {
28+
src: [files.tests],
29+
options: {
30+
coveralls: {
31+
serviceName: 'travis-ci',
32+
repoToken: process.env.COVERALLS_REPO_TOKEN
33+
}
34+
}
35+
},
36+
options: {
37+
reporter: 'spec',
38+
ignoreLeaks: false,
39+
files: [files.tests]
40+
}
41+
},
42+
watch: {
43+
tests: {
44+
files: _.toArray(files),
45+
tasks: ['test']
46+
}
47+
}
1348
});
1449

1550
// On watch events, configure jshint:all to run only on changed file
1651
grunt.event.on('watch', function(action, filepath) {
1752
grunt.config(['jshint', 'all'], filepath);
1853
});
1954

55+
// Load third-party modules
56+
grunt.loadNpmTasks('grunt-contrib-jshint');
57+
grunt.loadNpmTasks('grunt-contrib-watch');
58+
grunt.loadNpmTasks('grunt-mocha-cov');
59+
60+
// Tasks
61+
// grunt.registerTask('travis', [ 'jshint', 'mochacov:test', 'mochacov:coverage' ]);
62+
grunt.registerTask('travis', [ 'mochacov:test' ]);
63+
grunt.registerTask('test', ['jshint:all', 'mochacov:test']);
64+
65+
// Default task (runs when running `grunt` without arguments)
66+
grunt.registerTask('default', ['test']);
2067
};

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
},
4141
"devDependencies": {
4242
"chai": "~3.5.0",
43+
"grunt": "^1.0.1",
44+
"grunt-contrib-jshint": "^1.1.0",
45+
"grunt-contrib-watch": "^1.0.0",
46+
"grunt-mocha-cov": "^0.4.0",
4347
"mocha": "~3.2.0"
4448
}
4549
}

0 commit comments

Comments
 (0)