[tests/browser] generate css before testsBundle, include css (#23794)

This commit is contained in:
Jonathan Budzenski 2018-10-04 11:10:20 -05:00 committed by Jonathan Budzenski
parent 1f13ee6421
commit e2ec868588
No known key found for this signature in database
GPG key ID: D28BF9418FA0F292
4 changed files with 11 additions and 4 deletions

View file

@ -70,6 +70,7 @@ export default (kibana) => {
}
testGlobs.push(`${plugin.publicDir}/**/__tests__/**/*.js`);
testGlobs.push(`${plugin.publicDir}/**/*.css`);
});
} else {
// add the modules from all of the apps
@ -79,6 +80,7 @@ export default (kibana) => {
for (const plugin of plugins) {
testGlobs.push(`${plugin.publicDir}/**/__tests__/**/*.js`);
testGlobs.push(`${plugin.publicDir}/**/*.css`);
}
}

View file

@ -71,11 +71,9 @@ module.exports = function (grunt) {
// list of files / patterns to load in the browser
files: [
'http://localhost:5610/bundles/vendors.bundle.js',
'http://localhost:5610/bundles/commons.bundle.js',
'http://localhost:5610/bundles/tests.bundle.js',
'http://localhost:5610/bundles/vendors.style.css',
'http://localhost:5610/bundles/commons.style.css',
'http://localhost:5610/bundles/tests.style.css'
],

View file

@ -128,6 +128,13 @@ module.exports = function (grunt) {
...browserTestServerFlags,
]
}),
browserSCSS: createKbnServerTask({
flags: [
...browserTestServerFlags,
'--optimize',
'--optimize.enabled=false'
]
}),
// used by the test:coverage task
// runs the kibana server to serve the instrumented version of the browser test bundle

View file

@ -33,7 +33,7 @@ module.exports = function (grunt) {
grunt.registerTask('test:server', ['checkPlugins', 'run:mocha']);
grunt.registerTask('test:browser', ['checkPlugins', 'run:browserTestServer', 'karma:unit']);
grunt.registerTask('test:browser', ['checkPlugins', 'run:browserSCSS', 'run:browserTestServer', 'karma:unit']);
grunt.registerTask('test:browser-ci', () => {
const ciShardTasks = keys(grunt.config.get('karma'))
@ -41,7 +41,7 @@ module.exports = function (grunt) {
.map(key => `karma:${key}`);
grunt.log.ok(`Running UI tests in ${ciShardTasks.length} shards`);
grunt.task.run(['run:browserSCSS']);
grunt.task.run(['run:browserTestServer', ...ciShardTasks]);
});