diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2016-12-30 00:42:48 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-01-10 21:30:40 +0300 |
commit | 7c47cc94c5d7425583db3610c85cb150df601a91 (patch) | |
tree | 2544c6ac133e4abba79dcacb2a10df24e79224d6 /config | |
parent | 3eb8569778ce2559eedab706f6f901238e39b355 (diff) |
Swapped out teaspoon for karma
Diffstat (limited to 'config')
-rw-r--r-- | config/karma.config.js | 27 | ||||
-rw-r--r-- | config/webpack.config.js | 7 |
2 files changed, 32 insertions, 2 deletions
diff --git a/config/karma.config.js b/config/karma.config.js new file mode 100644 index 00000000000..478ef082547 --- /dev/null +++ b/config/karma.config.js @@ -0,0 +1,27 @@ +var path = require('path'); +var webpackConfig = require('./webpack.config.js'); +var ROOT_PATH = path.resolve(__dirname, '..'); + +// Karma configuration +module.exports = function(config) { + config.set({ + basePath: ROOT_PATH, + frameworks: ['jquery-2.1.0', 'jasmine'], + files: [ + 'spec/javascripts/*_spec.js', + 'spec/javascripts/*_spec.js.es6', + { pattern: 'spec/javascripts/fixtures/**/*.html', included: false, served: true }, + { pattern: 'spec/javascripts/fixtures/**/*.json', included: false, served: true }, + ], + preprocessors: { + 'spec/javascripts/*_spec.js': ['webpack'], + 'spec/javascripts/*_spec.js.es6': ['webpack'], + 'app/assets/javascripts/**/*.js': ['webpack'], + 'app/assets/javascripts/**/*.js.es6': ['webpack'], + }, + + webpack: webpackConfig, + + webpackMiddleware: { stats: 'errors-only' }, + }); +}; diff --git a/config/webpack.config.js b/config/webpack.config.js index da2a19838e4..5cba995888a 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -58,7 +58,7 @@ var config = { { test: /\.(js|es6)$/, loader: 'imports-loader', - query: 'this=>window' + query: '$=jquery,jQuery=jquery,this=>window' }, { test: /\.json$/, @@ -87,7 +87,10 @@ var config = { 'vendor': path.join(ROOT_PATH, 'vendor/assets/javascripts'), 'vue$': 'vue/dist/vue.js', 'vue-resource$': 'vue-resource/dist/vue-resource.js' - } + }, + root: [ + path.join(ROOT_PATH, 'app/assets/javascripts'), + ], } } |