wildduck/Gruntfile.js

63 lines
1.7 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: {
imap: {
2017-03-06 05:45:50 +08:00
options: {
reporter: 'spec'
},
// imap-core tests first
src: ['imap-core/test/**/*-test.js']
},
api: {
options: {
reporter: 'spec'
},
// api tests
src: ['test/**/*-test.js']
2017-03-06 05:45:50 +08:00
}
2017-07-26 20:50:54 +08:00
},
wait: {
server: {
options: {
2022-12-15 17:13:58 +08:00
delay: 12 * 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']);
grunt.registerTask('proto', ['mochaTest:imap']);
2017-03-06 05:45:50 +08:00
};