From b0341c14d0657b41203b7e5d6d6cbeb64d67b387 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 6 Jan 2017 17:30:54 -0600 Subject: move additional libraries into spec_helper --- spec/javascripts/activities_spec.js.es6 | 1 - spec/javascripts/awards_handler_spec.js | 1 - spec/javascripts/boards/boards_store_spec.js.es6 | 4 ---- spec/javascripts/boards/issue_spec.js.es6 | 4 ---- spec/javascripts/boards/list_spec.js.es6 | 4 ---- spec/javascripts/dashboard_spec.js.es6 | 1 - spec/javascripts/environments/environment_actions_spec.js.es6 | 1 - spec/javascripts/environments/environment_external_url_spec.js.es6 | 1 - spec/javascripts/environments/environment_item_spec.js.es6 | 1 - spec/javascripts/environments/environment_rollback_spec.js.es6 | 1 - spec/javascripts/environments/environment_stop_spec.js.es6 | 1 - spec/javascripts/environments/environments_store_spec.js.es6 | 1 - spec/javascripts/right_sidebar_spec.js | 1 - spec/javascripts/spec_helper.js | 4 ++++ 14 files changed, 4 insertions(+), 22 deletions(-) diff --git a/spec/javascripts/activities_spec.js.es6 b/spec/javascripts/activities_spec.js.es6 index feba184dbb0..cf57ca34a79 100644 --- a/spec/javascripts/activities_spec.js.es6 +++ b/spec/javascripts/activities_spec.js.es6 @@ -1,6 +1,5 @@ /* eslint-disable no-unused-expressions, comma-spacing, prefer-const, no-prototype-builtins, semi, no-new, keyword-spacing, no-plusplus, no-shadow, max-len */ -window.Cookies = require('vendor/js.cookie'); require('vendor/jquery.endless-scroll.js'); require('pager'); require('activities'); diff --git a/spec/javascripts/awards_handler_spec.js b/spec/javascripts/awards_handler_spec.js index 65efa3df90b..6950e7a2ce4 100644 --- a/spec/javascripts/awards_handler_spec.js +++ b/spec/javascripts/awards_handler_spec.js @@ -2,7 +2,6 @@ /* global AwardsHandler */ require('awards_handler'); -window.Cookies = require('vendor/js.cookie'); require('./fixtures/emoji_menu'); (function() { diff --git a/spec/javascripts/boards/boards_store_spec.js.es6 b/spec/javascripts/boards/boards_store_spec.js.es6 index 7817e7c1b92..a94f107f67c 100644 --- a/spec/javascripts/boards/boards_store_spec.js.es6 +++ b/spec/javascripts/boards/boards_store_spec.js.es6 @@ -6,10 +6,6 @@ /* global listObj */ /* global listObjDuplicate */ -require('jquery-ujs'); -window.Cookies = require('vendor/js.cookie'); -window.Vue = require('vue'); -window.Vue.use(require('vue-resource')); require('lib/utils/url_utility'); require('boards/models/issue'); require('boards/models/label'); diff --git a/spec/javascripts/boards/issue_spec.js.es6 b/spec/javascripts/boards/issue_spec.js.es6 index cf2485bff8d..2f38bea7d48 100644 --- a/spec/javascripts/boards/issue_spec.js.es6 +++ b/spec/javascripts/boards/issue_spec.js.es6 @@ -2,10 +2,6 @@ /* global BoardService */ /* global ListIssue */ -require('jquery-ujs'); -window.Cookies = require('vendor/js.cookie'); -window.Vue = require('vue'); -window.Vue.use(require('vue-resource')); require('lib/utils/url_utility'); require('boards/models/issue'); require('boards/models/label'); diff --git a/spec/javascripts/boards/list_spec.js.es6 b/spec/javascripts/boards/list_spec.js.es6 index 65094642b64..edd472573de 100644 --- a/spec/javascripts/boards/list_spec.js.es6 +++ b/spec/javascripts/boards/list_spec.js.es6 @@ -5,10 +5,6 @@ /* global List */ /* global listObj */ -require('jquery-ujs'); -window.Cookies = require('vendor/js.cookie'); -window.Vue = require('vue'); -window.Vue.use(require('vue-resource')); require('lib/utils/url_utility'); require('boards/models/issue'); require('boards/models/label'); diff --git a/spec/javascripts/dashboard_spec.js.es6 b/spec/javascripts/dashboard_spec.js.es6 index 5fb101fd584..b9e819aa218 100644 --- a/spec/javascripts/dashboard_spec.js.es6 +++ b/spec/javascripts/dashboard_spec.js.es6 @@ -1,7 +1,6 @@ /* eslint-disable no-new, padded-blocks */ require('sidebar'); -window.Cookies = require('vendor/js.cookie'); require('lib/utils/text_utility'); ((global) => { diff --git a/spec/javascripts/environments/environment_actions_spec.js.es6 b/spec/javascripts/environments/environment_actions_spec.js.es6 index 304c3dccd1e..c02c2e10b9a 100644 --- a/spec/javascripts/environments/environment_actions_spec.js.es6 +++ b/spec/javascripts/environments/environment_actions_spec.js.es6 @@ -1,4 +1,3 @@ -window.Vue = require('vue'); require('environments/components/environment_actions'); describe('Actions Component', () => { diff --git a/spec/javascripts/environments/environment_external_url_spec.js.es6 b/spec/javascripts/environments/environment_external_url_spec.js.es6 index d50971583a1..5270ebef0ae 100644 --- a/spec/javascripts/environments/environment_external_url_spec.js.es6 +++ b/spec/javascripts/environments/environment_external_url_spec.js.es6 @@ -1,4 +1,3 @@ -window.Vue = require('vue'); require('environments/components/environment_external_url'); describe('External URL Component', () => { diff --git a/spec/javascripts/environments/environment_item_spec.js.es6 b/spec/javascripts/environments/environment_item_spec.js.es6 index f6079afd617..400850db028 100644 --- a/spec/javascripts/environments/environment_item_spec.js.es6 +++ b/spec/javascripts/environments/environment_item_spec.js.es6 @@ -1,4 +1,3 @@ -window.Vue = require('vue'); window.timeago = require('vendor/timeago'); require('environments/components/environment_item'); diff --git a/spec/javascripts/environments/environment_rollback_spec.js.es6 b/spec/javascripts/environments/environment_rollback_spec.js.es6 index 87ffd76c152..96d80d59b9a 100644 --- a/spec/javascripts/environments/environment_rollback_spec.js.es6 +++ b/spec/javascripts/environments/environment_rollback_spec.js.es6 @@ -1,4 +1,3 @@ -window.Vue = require('vue'); require('environments/components/environment_rollback'); describe('Rollback Component', () => { diff --git a/spec/javascripts/environments/environment_stop_spec.js.es6 b/spec/javascripts/environments/environment_stop_spec.js.es6 index b0b8f355fde..a243b967425 100644 --- a/spec/javascripts/environments/environment_stop_spec.js.es6 +++ b/spec/javascripts/environments/environment_stop_spec.js.es6 @@ -1,4 +1,3 @@ -window.Vue = require('vue'); require('environments/components/environment_stop'); describe('Stop Component', () => { diff --git a/spec/javascripts/environments/environments_store_spec.js.es6 b/spec/javascripts/environments/environments_store_spec.js.es6 index bcbe214eb05..090179ce873 100644 --- a/spec/javascripts/environments/environments_store_spec.js.es6 +++ b/spec/javascripts/environments/environments_store_spec.js.es6 @@ -1,6 +1,5 @@ /* global environmentsList */ -window.Vue = require('vue'); require('environments/stores/environments_store'); require('./mock_data'); diff --git a/spec/javascripts/right_sidebar_spec.js b/spec/javascripts/right_sidebar_spec.js index 026ae04eb21..db6b7244135 100644 --- a/spec/javascripts/right_sidebar_spec.js +++ b/spec/javascripts/right_sidebar_spec.js @@ -2,7 +2,6 @@ /* global Sidebar */ require('right_sidebar'); -window.Cookies = require('vendor/js.cookie'); require('extensions/jquery.js'); (function() { diff --git a/spec/javascripts/spec_helper.js b/spec/javascripts/spec_helper.js index 64f1ca4b80d..b55f08e3311 100644 --- a/spec/javascripts/spec_helper.js +++ b/spec/javascripts/spec_helper.js @@ -3,6 +3,10 @@ require('jasmine-jquery'); // 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'); -- cgit v1.2.1