Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Commit

Permalink
Compile component sass files for use during testing (#522)
Browse files Browse the repository at this point in the history
* Compile component sass files for use during testing

* Update karma.config.js
  • Loading branch information
JakeChampion authored Apr 23, 2018
1 parent 03cb243 commit bc1fae2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
17 changes: 12 additions & 5 deletions config/karma.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
const process = require('process');

const path = require('path');
const webpackConfig = require('./webpack.config.dev');

// https://github.com/webpack/webpack/issues/3324#issuecomment-289720345
delete webpackConfig.bail;

module.exports = {

// enable / disable watching file and executing tests whenever any file changes
Expand Down Expand Up @@ -38,7 +37,8 @@ module.exports = {
// list of files / patterns to load in the browser
files: [
'test/*.js',
'test/**/*.js'
'test/**/*.js',
'main.scss'
],

// frameworks to use
Expand All @@ -51,7 +51,8 @@ module.exports = {
'karma-webpack',
'karma-browserstack-launcher',
'karma-chrome-launcher',
'karma-sourcemap-loader'
'karma-sourcemap-loader',
'karma-scss-preprocessor'
],

// web server port
Expand All @@ -61,7 +62,13 @@ module.exports = {
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'test/*.js': ['webpack', 'sourcemap'],
'test/**/*.js': ['webpack', 'sourcemap']
'test/**/*.js': ['webpack', 'sourcemap'],
'main.scss': ['scss']
},
scssPreprocessor: {
options: {
includePaths: [process.cwd(), path.join(process.cwd(), 'bower_components')]
}
},

// Continuous Integration mode
Expand Down
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"karma-browserstack-launcher": "^1.3.0",
"karma-chrome-launcher": "^2.2.0",
"karma-mocha": "^1.3.0",
"karma-scss-preprocessor": "^3.0.0",
"karma-sinon": "^1.0.5",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.5",
Expand Down

0 comments on commit bc1fae2

Please sign in to comment.