diff options
-rw-r--r-- | spec/javascripts/test_bundle.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js index 0464b5d2329..3b6c16adb65 100644 --- a/spec/javascripts/test_bundle.js +++ b/spec/javascripts/test_bundle.js @@ -14,10 +14,25 @@ window.gl = window.gl || {}; window.gl.TEST_HOST = 'http://test.host'; window.gon = window.gon || {}; +class PatchedSuite extends jasmine.Suite { + constructor(attrs) { + super(Object.assign(attrs, { + description: PatchedSuite.appendFileName(attrs.description), + })); + } + + static appendFileName(description) { + return `${description} (${PatchedSuite.currentFileName})`; + } +} + +jasmine.Suite = PatchedSuite; + // render all of our tests const testsContext = require.context('.', true, /_spec$/); testsContext.keys().forEach(function (path) { try { + PatchedSuite.currentFileName = path.replace(/^\.\//, 'spec/javascripts/'); testsContext(path); } catch (err) { console.error('[ERROR] Unable to load spec: ', path); |