diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-01-06 18:19:42 -0600 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-01-10 12:30:43 -0600 |
commit | a8078d629e50ec1ea0e562e24e7bd7ea8931d896 (patch) | |
tree | 848320b551cc9a79bcee9f88d3403d305116d89a /spec/javascripts/test_bundle.js | |
parent | b0341c14d0657b41203b7e5d6d6cbeb64d67b387 (diff) | |
download | gitlab-ce-a8078d629e50ec1ea0e562e24e7bd7ea8931d896.tar.gz |
migrate all tests into a single webpack bundle
Diffstat (limited to 'spec/javascripts/test_bundle.js')
-rw-r--r-- | spec/javascripts/test_bundle.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js new file mode 100644 index 00000000000..cbe8abbbc08 --- /dev/null +++ b/spec/javascripts/test_bundle.js @@ -0,0 +1,42 @@ +// enable test fixtures +require('jasmine-jquery'); + +jasmine.getFixtures().fixturesPath = 'base/spec/javascripts/fixtures'; +jasmine.getJSONFixtures().fixturesPath = 'base/spec/javascripts/fixtures'; + +// include common libraries +window.$ = window.jQuery = require('jquery'); +window._ = require('underscore'); +window.Cookies = require('vendor/js.cookie'); +window.Vue = require('vue'); +window.Vue.use(require('vue-resource')); +require('jquery-ujs'); +require('vendor/turbolinks'); +require('vendor/jquery.turbolinks'); +require('bootstrap/js/affix'); +require('bootstrap/js/alert'); +require('bootstrap/js/button'); +require('bootstrap/js/collapse'); +require('bootstrap/js/dropdown'); +require('bootstrap/js/modal'); +require('bootstrap/js/scrollspy'); +require('bootstrap/js/tab'); +require('bootstrap/js/transition'); +require('bootstrap/js/tooltip'); +require('bootstrap/js/popover'); + +// stub expected globals +window.gl = window.gl || {}; +window.gl.TEST_HOST = 'http://test.host'; +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); + } +}); |