kibana/tasks/test.js

91 lines
2.1 KiB
JavaScript
Raw Normal View History

const _ = require('lodash');
const visualRegression = require('../utilities/visual_regression');
module.exports = function (grunt) {
grunt.registerTask('test:visualRegression', [
'intern:visualRegression:takeScreenshots',
'test:visualRegression:buildGallery'
]);
grunt.registerTask('test:visualRegression:takeScreenshots', [
'clean:screenshots',
'intern:visualRegression'
]);
grunt.registerTask(
'test:visualRegression:buildGallery',
'Compare screenshots and generate diff images.',
function () {
const done = this.async();
visualRegression.run(done);
}
);
grunt.registerTask('test:server', [ 'esvm:test', 'simplemocha:all', 'esvm_shutdown:test' ]);
grunt.registerTask('test:browser', [ 'run:testServer', 'karma:unit' ]);
2015-08-25 02:10:21 +02:00
grunt.registerTask('test:coverage', [ 'run:testCoverageServer', 'karma:coverage' ]);
grunt.registerTask('test:quick', [
'test:server',
'test:ui',
'test:browser',
'test:api'
]);
grunt.registerTask('test:dev', [
'run:devTestServer',
'karma:dev'
]);
grunt.registerTask('test:ui', [
'esvm:ui',
'run:testUIServer',
'run:chromeDriver',
'clean:screenshots',
'intern:dev',
'esvm_shutdown:ui',
'stop:chromeDriver',
'stop:testUIServer'
]);
2015-09-11 21:08:35 +02:00
grunt.registerTask('test:ui:server', [
'esvm:ui',
'run:testUIServer',
'run:devChromeDriver:keepalive'
2015-09-11 21:08:35 +02:00
]);
grunt.registerTask('test:ui:runner', [
'clean:screenshots',
2015-09-11 21:08:35 +02:00
'intern:dev'
]);
2015-11-17 19:01:45 +01:00
grunt.registerTask('test:api', [
'esvm:ui',
'run:apiTestServer',
'intern:api',
'esvm_shutdown:ui',
'stop:apiTestServer'
]);
grunt.registerTask('test:api:server', [
'esvm:ui',
'run:apiTestServer:keepalive'
]);
grunt.registerTask('test:api:runner', [
'intern:api'
]);
grunt.registerTask('test', subTask => {
if (subTask) grunt.fail.fatal(`invalid task "test:${subTask}"`);
2015-07-28 02:13:45 +02:00
grunt.task.run(_.compact([
!grunt.option('quick') && 'eslint:source',
2016-05-02 18:55:55 +02:00
'licenses',
'test:quick'
2015-07-28 02:13:45 +02:00
]));
});
grunt.registerTask('quick-test', ['test:quick']); // historical alias
};