migrate all tests into a single webpack bundle
This commit is contained in:
parent
b0341c14d0
commit
a8078d629e
|
@ -8,8 +8,7 @@ module.exports = function(config) {
|
||||||
basePath: ROOT_PATH,
|
basePath: ROOT_PATH,
|
||||||
frameworks: ['jasmine'],
|
frameworks: ['jasmine'],
|
||||||
files: [
|
files: [
|
||||||
'spec/javascripts/spec_helper.js',
|
'spec/javascripts/test_bundle.js',
|
||||||
'spec/javascripts/**/*_spec.js?(.es6)',
|
|
||||||
{ pattern: 'spec/javascripts/fixtures/**/*@(.json|.html|.html.raw)', included: false },
|
{ pattern: 'spec/javascripts/fixtures/**/*@(.json|.html|.html.raw)', included: false },
|
||||||
],
|
],
|
||||||
preprocessors: {
|
preprocessors: {
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
},
|
},
|
||||||
"plugins": ["jasmine"],
|
"plugins": ["jasmine"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"prefer-arrow-callback": 0,
|
"func-names": 0,
|
||||||
"func-names": 0
|
"no-console": 0,
|
||||||
|
"prefer-arrow-callback": 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
|
// enable test fixtures
|
||||||
require('jasmine-jquery');
|
require('jasmine-jquery');
|
||||||
|
|
||||||
|
jasmine.getFixtures().fixturesPath = 'base/spec/javascripts/fixtures';
|
||||||
|
jasmine.getJSONFixtures().fixturesPath = 'base/spec/javascripts/fixtures';
|
||||||
|
|
||||||
// include common libraries
|
// include common libraries
|
||||||
window.$ = window.jQuery = require('jquery');
|
window.$ = window.jQuery = require('jquery');
|
||||||
window._ = require('underscore');
|
window._ = require('underscore');
|
||||||
|
@ -21,11 +25,18 @@ require('bootstrap/js/transition');
|
||||||
require('bootstrap/js/tooltip');
|
require('bootstrap/js/tooltip');
|
||||||
require('bootstrap/js/popover');
|
require('bootstrap/js/popover');
|
||||||
|
|
||||||
// configure jasmine
|
|
||||||
jasmine.getFixtures().fixturesPath = 'base/spec/javascripts/fixtures';
|
|
||||||
jasmine.getJSONFixtures().fixturesPath = 'base/spec/javascripts/fixtures';
|
|
||||||
|
|
||||||
// stub expected globals
|
// stub expected globals
|
||||||
window.gl = window.gl || {};
|
window.gl = window.gl || {};
|
||||||
window.gl.TEST_HOST = 'http://test.host';
|
window.gl.TEST_HOST = 'http://test.host';
|
||||||
window.gon = window.gon || {};
|
window.gon = window.gon || {};
|
||||||
|
|
||||||
|
// render all of our tests
|
||||||
|
const testsContext = require.context('.', true, /_spec$/);
|
||||||
|
testsContext.keys().forEach(function (path) {
|
||||||
|
try {
|
||||||
|
testsContext(path);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('[ERROR] WITH SPEC FILE: ', path);
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
});
|
Loading…
Reference in New Issue