Skip to content

Commit c2086fa

Browse files
ryanflorencemjackson
authored andcommitted
get tests passing again
webpack-karma was bundled everything into every single spec we had (5 copies of react, 5 copies of the router, etc). While having to put every spec we want to require into the specs/main.js file isn’t ideal, it works. I imagine there is some configuration option I’m unaware of that removes the need for this workaround. Also, Promise was not being required, some environments have it, some don’t.
1 parent 47eb68e commit c2086fa

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

karma.conf.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@ module.exports = function(config) {
66
frameworks: ['mocha'],
77

88
files: [
9-
'specs/*.spec.*'
9+
'specs/main.js'
1010
],
1111

1212
exclude: [],
1313

1414
preprocessors: {
15-
'specs/*spec.*': ['webpack']
15+
'specs/main.js': ['webpack']
1616
},
1717

1818
webpack: {
1919
cache: true,
20+
// TODO: figure out how to get source maps in here, none of this works
21+
//devtool: {
22+
//'inline-source-map': true,
23+
//inlineSourceMap: true
24+
//},
2025
module: {
2126
loaders: [
2227
{test: /\.js$/, loader: 'jsx-loader'}

modules/components/Route.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var Path = require('../helpers/Path');
1111
var ActiveStore = require('../stores/ActiveStore');
1212
var RouteStore = require('../stores/RouteStore');
1313
var URLStore = require('../stores/URLStore');
14+
var Promise = require('es6-promise').Promise;
1415

1516
var RESERVED_PROPS = {
1617
location: true,

specs/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// TODO: this is for webkpack-karma to only create one build instead of a build
2+
// for every spec file, there must be some sort of config but I can't find it ...
3+
require('./ActiveStore.spec.js');
4+
require('./Path.spec.js');
5+
require('./Route.spec.js');
6+
require('./RouteStore.spec.js');
7+
require('./URLStore.spec.js');
8+

0 commit comments

Comments
 (0)