wildduck/Gruntfile.js

50 lines
1.3 KiB
JavaScript
Raw Normal View History

2017-03-06 05:45:50 +08:00
'use strict';
2019-05-07 15:27:30 +08:00
process.env.NODE_ENV = 'test';
2017-06-03 14:51:58 +08:00
module.exports = function(grunt) {
2017-03-06 05:45:50 +08:00
// Project configuration.
grunt.initConfig({
eslint: {
all: ['lib/**/*.js', 'imap-core/**/*.js', 'test/**/*.js', 'examples/**/*.js', 'Gruntfile.js']
},
mochaTest: {
all: {
options: {
reporter: 'spec'
},
2017-12-13 16:33:13 +08:00
// run imap-core tests first
src: ['imap-core/test/**/*-test.js', 'test/**/*-test.js']
2017-03-06 05:45:50 +08:00
}
2017-07-26 20:50:54 +08:00
},
wait: {
server: {
options: {
delay: 7 * 1000
}
}
},
shell: {
server: {
command: 'node server.js',
options: {
async: true
}
}
2017-03-06 05:45:50 +08:00
}
});
// Load the plugin(s)
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-mocha-test');
2017-07-26 20:50:54 +08:00
grunt.loadNpmTasks('grunt-shell-spawn');
grunt.loadNpmTasks('grunt-wait');
2017-03-06 05:45:50 +08:00
// Tasks
2017-07-26 20:50:54 +08:00
grunt.registerTask('default', ['eslint', 'shell:server', 'wait:server', 'mochaTest', 'shell:server:kill']);
2019-05-07 15:27:30 +08:00
grunt.registerTask('testonly', ['shell:server', 'wait:server', 'mochaTest', 'shell:server:kill']);
2017-03-06 05:45:50 +08:00
};