diff options
author | Lukas Eipert <git@leipert.io> | 2018-04-10 22:28:33 +0200 |
---|---|---|
committer | Lukas Eipert <git@leipert.io> | 2018-04-10 22:28:33 +0200 |
commit | 7f2244eea5017c63abc227e31a08a28b66d25f35 (patch) | |
tree | 1fb80b631ba8257d6c1023863ed8a8c5d80c7007 /spec/javascripts/test_bundle.js | |
parent | a8bf6a306c57d8a2901a8a843ec64c0c6c516b8f (diff) | |
download | gitlab-ce-7f2244eea5017c63abc227e31a08a28b66d25f35.tar.gz |
move TEST_FILES variable to `process.env`
Diffstat (limited to 'spec/javascripts/test_bundle.js')
-rw-r--r-- | spec/javascripts/test_bundle.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js index 7eeaec8e93f..0fb037efa25 100644 --- a/spec/javascripts/test_bundle.js +++ b/spec/javascripts/test_bundle.js @@ -71,21 +71,20 @@ beforeEach(() => { const axiosDefaultAdapter = getDefaultAdapter(); -// eslint-disable-next-line no-undef -let testFile = TEST_FILES; -if (testFile instanceof Array && testFile.length > 0) { - console.log(`Running only tests: ${testFile}`); - testFile = testFile.map(path => path.replace(/^spec\/javascripts\//, '').replace(/\.js$/, '')); +let testFiles = process.env.TEST_FILES; +if (testFiles instanceof Array && testFiles.length > 0) { + console.log(`Running only tests: ${testFiles}`); + testFiles = testFiles.map(path => path.replace(/^spec\/javascripts\//, '').replace(/\.js$/, '')); } else { console.log('Running all tests'); - testFile = []; + testFiles = []; } // render all of our tests const testsContext = require.context('.', true, /_spec$/); testsContext.keys().forEach(function(path) { try { - if (testFile.length === 0 || testFile.some(p => path.includes(p))) { + if (testFiles.length === 0 || testFiles.some(p => path.includes(p))) { testsContext(path); } } catch (err) { |