forked from react-boilerplate/react-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial Karma/Chrome config, get Button.test passing
- Loading branch information
Showing
3 changed files
with
78 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var path = require('path'); | ||
var webpackConfig = require('./webpack/webpack.test.babel'); | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
frameworks: ['mocha', 'chai'], | ||
|
||
browsers: process.env.TRAVIS | ||
? ['ChromeTravis'] | ||
: ['Chrome'], | ||
|
||
autoWatch: process.env.TRAVIS ? false : true, | ||
singleRun: process.env.TRAVIS ? true : false, | ||
|
||
files: [ | ||
'app/components/Button/Button.test.js' | ||
], | ||
|
||
preprocessors: { | ||
['app/components/Button/Button.test.js']: ['webpack', 'sourcemap'], | ||
}, | ||
|
||
webpack: webpackConfig | ||
}); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* TEST WEBPACK CONFIGURATION | ||
*/ | ||
|
||
module.exports = { | ||
devtool: 'inline-source-map', | ||
module: { | ||
// Some libraries don't like being run through babel. | ||
// If they gripe, put them here. | ||
noParse: [ | ||
/node_modules\/sinon/, | ||
/node_modules\/acorn/, | ||
], | ||
loaders: [ | ||
{ test: /\.js$/, loader: 'babel', exclude: [/node_modules/], }, | ||
{ test: /\.json$/, loader: 'json-loader' }, | ||
{ test: /\.css$/, loader: 'null-loader' }, | ||
] | ||
}, | ||
// Some node_modules pull in Node-specific dependencies. | ||
// Since we're running in a browser we have to stub them out. See: | ||
// https://webpack.github.io/docs/configuration.html#node | ||
// https://github.com/webpack/node-libs-browser/tree/master/mock | ||
// https://github.com/webpack/jade-loader/issues/8#issuecomment-55568520 | ||
node: { | ||
fs: 'empty', | ||
child_process: 'empty', | ||
net: 'empty', | ||
tls: 'empty', | ||
}, | ||
// required for enzyme to work properly | ||
externals: { | ||
jsdom: 'window', | ||
cheerio: 'window', | ||
'react/lib/ExecutionEnvironment': true, | ||
'react/lib/ReactContext': 'window' | ||
}, | ||
resolve: { | ||
alias: { | ||
// required for enzyme to work properly | ||
sinon: 'sinon/pkg/sinon' | ||
}, | ||
}, | ||
}; |