summaryrefslogtreecommitdiff
path: root/spec/javascripts/test_bundle.js
diff options
context:
space:
mode:
authorSanad Liaquat <sliaquat@gitlab.com>2019-03-15 11:52:39 +0500
committerSanad Liaquat <sliaquat@gitlab.com>2019-03-15 11:52:39 +0500
commite73f8713812b912b3b0244e99b6a18b9422a2d4d (patch)
treede67e0ab7931961752caeccef78f393365391f81 /spec/javascripts/test_bundle.js
parent82c0816d3fdd96412605845fa337b74b6a3534c4 (diff)
downloadgitlab-ce-qa-artillery-io-script.tar.gz
Add Load testing script for artillery.ioqa-artillery-io-script
Also add rake tasks that makes use of existing performance data genertion task.
Diffstat (limited to 'spec/javascripts/test_bundle.js')
-rw-r--r--spec/javascripts/test_bundle.js72
1 files changed, 27 insertions, 45 deletions
diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js
index 235a17d13b0..5eef5682bbd 100644
--- a/spec/javascripts/test_bundle.js
+++ b/spec/javascripts/test_bundle.js
@@ -69,7 +69,7 @@ window.gl = window.gl || {};
window.gl.TEST_HOST = TEST_HOST;
window.gon = window.gon || {};
window.gon.test_env = true;
-window.gon.ee = process.env.EE;
+window.gon.ee = false;
gon.relative_url_root = '';
let hasUnhandledPromiseRejections = false;
@@ -122,26 +122,19 @@ afterEach(() => {
const axiosDefaultAdapter = getDefaultAdapter();
// render all of our tests
-const testContexts = [require.context('spec', true, /_spec$/)];
-
-if (process.env.EE) {
- testContexts.push(require.context('ee_spec', true, /_spec$/));
-}
-
-testContexts.forEach(context => {
- context.keys().forEach(path => {
- try {
- context(path);
- } catch (err) {
- console.log(err);
- console.error('[GL SPEC RUNNER ERROR] Unable to load spec: ', path);
- describe('Test bundle', function() {
- it(`includes '${path}'`, function() {
- expect(err).toBeNull();
- });
+const testsContext = require.context('.', true, /_spec$/);
+testsContext.keys().forEach(function(path) {
+ try {
+ testsContext(path);
+ } catch (err) {
+ console.log(err);
+ console.error('[GL SPEC RUNNER ERROR] Unable to load spec: ', path);
+ describe('Test bundle', function() {
+ it(`includes '${path}'`, function() {
+ expect(err).toBeNull();
});
- }
- });
+ });
+ }
});
describe('test errors', () => {
@@ -211,35 +204,24 @@ if (process.env.BABEL_ENV === 'coverage') {
];
describe('Uncovered files', function() {
- const sourceFilesContexts = [require.context('~', true, /\.(js|vue)$/)];
-
- if (process.env.EE) {
- sourceFilesContexts.push(require.context('ee', true, /\.(js|vue)$/));
- }
-
- const allTestFiles = testContexts.reduce(
- (accumulator, context) => accumulator.concat(context.keys()),
- [],
- );
+ const sourceFiles = require.context('~', true, /\.(js|vue)$/);
$.holdReady(true);
- sourceFilesContexts.forEach(context => {
- context.keys().forEach(path => {
- // ignore if there is a matching spec file
- if (allTestFiles.indexOf(`${path.replace(/\.(js|vue)$/, '')}_spec`) > -1) {
- return;
- }
-
- it(`includes '${path}'`, function() {
- try {
- context(path);
- } catch (err) {
- if (troubleMakers.indexOf(path) === -1) {
- expect(err).toBeNull();
- }
+ sourceFiles.keys().forEach(function(path) {
+ // ignore if there is a matching spec file
+ if (testsContext.keys().indexOf(`${path.replace(/\.(js|vue)$/, '')}_spec`) > -1) {
+ return;
+ }
+
+ it(`includes '${path}'`, function() {
+ try {
+ sourceFiles(path);
+ } catch (err) {
+ if (troubleMakers.indexOf(path) === -1) {
+ expect(err).toBeNull();
}
- });
+ }
});
});
});