diff options
author | Phil Hughes <me@iamphill.com> | 2018-04-10 16:48:02 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-04-10 16:48:02 +0100 |
commit | 2ec6a7e101c3c98153f4769cb70e761a2d4e3e69 (patch) | |
tree | b04a59ccfd2349c523af13fb381619e03ba24b35 /spec/javascripts/test_bundle.js | |
parent | 23fb465c75d00fd7156a540b7421a79e22df3966 (diff) | |
download | gitlab-ce-2ec6a7e101c3c98153f4769cb70e761a2d4e3e69.tar.gz |
Fixed markdown preview in IDE not working for new files
Diffstat (limited to 'spec/javascripts/test_bundle.js')
-rw-r--r-- | spec/javascripts/test_bundle.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js index d158786e484..f595feec949 100644 --- a/spec/javascripts/test_bundle.js +++ b/spec/javascripts/test_bundle.js @@ -22,7 +22,7 @@ Vue.config.warnHandler = (msg, vm, trace) => { }; let hasVueErrors = false; -Vue.config.errorHandler = function (err) { +Vue.config.errorHandler = function(err) { hasVueErrors = true; fail(err); }; @@ -43,10 +43,11 @@ window.gl = window.gl || {}; window.gl.TEST_HOST = TEST_HOST; window.gon = window.gon || {}; window.gon.test_env = true; +gon.relative_url_root = ''; let hasUnhandledPromiseRejections = false; -window.addEventListener('unhandledrejection', (event) => { +window.addEventListener('unhandledrejection', event => { hasUnhandledPromiseRejections = true; console.error('Unhandled promise rejection:'); console.error(event.reason.stack || event.reason); @@ -71,13 +72,13 @@ const axiosDefaultAdapter = getDefaultAdapter(); // render all of our tests const testsContext = require.context('.', true, /_spec$/); -testsContext.keys().forEach(function (path) { +testsContext.keys().forEach(function(path) { try { testsContext(path); } catch (err) { console.error('[ERROR] Unable to load spec: ', path); - describe('Test bundle', function () { - it(`includes '${path}'`, function () { + describe('Test bundle', function() { + it(`includes '${path}'`, function() { expect(err).toBeNull(); }); }); @@ -85,7 +86,7 @@ testsContext.keys().forEach(function (path) { }); describe('test errors', () => { - beforeAll((done) => { + beforeAll(done => { if (hasUnhandledPromiseRejections || hasVueWarnings || hasVueErrors) { setTimeout(done, 1000); } else { @@ -149,18 +150,18 @@ if (process.env.BABEL_ENV === 'coverage') { './issue_show/index.js', ]; - describe('Uncovered files', function () { + describe('Uncovered files', function() { const sourceFiles = require.context('~', true, /\.js$/); $.holdReady(true); - sourceFiles.keys().forEach(function (path) { + sourceFiles.keys().forEach(function(path) { // ignore if there is a matching spec file if (testsContext.keys().indexOf(`${path.replace(/\.js$/, '')}_spec`) > -1) { return; } - it(`includes '${path}'`, function () { + it(`includes '${path}'`, function() { try { sourceFiles(path); } catch (err) { |