xmpp.chapril.org-conversejs/Gruntfile.js
JC Brand 8e04ea51c3 Add grunt task to run the tests.
- Removed phantom-jasmine, not used.
- Updated CONTRIBUTING.rst
2013-07-28 22:51:25 +02:00

39 lines
1.2 KiB
JavaScript

module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
trailing: true
},
target: {
src : [
'converse.js',
'mock.js',
'main.js',
'tests_main.js',
'spec/*.js'
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.registerTask('test', 'Run Tests', function () {
var done = this.async();
var child_process = require('child_process');
var exec = child_process.exec;
exec('phantomjs '+
'node_modules/jasmine-reporters/test/phantomjs-testrunner.js '+
__dirname+'/tests.html',
function (err, stdout, stderr) {
if (err) {
grunt.log.write('Tests failed with error code '+err.code);
grunt.log.write(stderr);
}
grunt.log.write(stdout);
done();
});
});
grunt.registerTask('default', 'Perform all checks (e.g. before releasing)', function () {
grunt.task.run('jshint', 'test');
});
};