wildduck/Gruntfile.js

55 lines
1.5 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';
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: 25 * 1000
2017-07-26 20:50:54 +08:00
}
}
},
shell: {
server: {
command: 'node server.js',
options: {
async: true
}
2021-07-05 05:04:00 +08:00
},
options: {
stdout: data => console.log(data.toString().trim()),
stderr: data => console.log(data.toString().trim()),
failOnError: true
2017-07-26 20:50:54 +08:00
}
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
};