-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure Karma as an option for test environment
- Loading branch information
1 parent
35efc6b
commit 0e8a47f
Showing
4 changed files
with
64 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,47 @@ | ||
'use strict'; | ||
|
||
var babelOptions = { | ||
presets: ['metal'], | ||
sourceMap: 'both' | ||
}; | ||
const extractTextPlugin = require("extract-text-webpack-plugin"); | ||
const karmaWebpack = require('karma-webpack'); | ||
const sourceMapLoader = require("karma-sourcemap-loader"); | ||
const metalKarmaConfig = require("metal-karma-config"); | ||
|
||
module.exports = function (config) { | ||
config.set({ | ||
frameworks: ['mocha', 'chai', 'source-map-support', 'commonjs'], | ||
|
||
files: [ | ||
'node_modules/metal-soy-bundle/build/bundle.js', | ||
'node_modules/html2incdom/src/*.js', | ||
'node_modules/metal*/src/**/*.js', | ||
'src/**/*.js', | ||
'test/**/*.js' | ||
metalKarmaConfig(config); | ||
config.plugins.push(karmaWebpack, sourceMapLoader); | ||
config.set({ | ||
frameworks: ['mocha', 'chai', 'sinon'], | ||
|
||
files: [ | ||
'__tests__/**/*.js' | ||
], | ||
|
||
preprocessors: { | ||
'src/**/*.js': ['babel', 'commonjs'], | ||
'node_modules/html2incdom/src/*.js': ['babel', 'commonjs'], | ||
'node_modules/metal-soy-bundle/build/bundle.js': ['commonjs'], | ||
'node_modules/metal*/src/**/*.js': ['babel', 'commonjs'], | ||
'test/**/*.js': ['babel', 'commonjs'] | ||
webpack: { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.scss$/, | ||
use: extractTextPlugin.extract({ | ||
fallback: "style-loader", | ||
use: "css-loader" | ||
}) | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new extractTextPlugin("styles.css"), | ||
] | ||
}, | ||
|
||
webpackMiddleware: { | ||
noInfo: true | ||
}, | ||
|
||
preprocessors: { | ||
'__tests__/**/*.js': ['webpack', 'sourcemap'] | ||
}, | ||
|
||
browsers: ['Chrome'], | ||
singleRun: true, | ||
|
||
babelPreprocessor: {options: babelOptions} | ||
}); | ||
browsers: ['Chrome'] | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters