Created
September 23, 2016 19:05
-
-
Save naganowl/e3e8ff73b7b6d371bb942acd588cc792 to your computer and use it in GitHub Desktop.
Make a single file with all tests for karma to consume
This file contains hidden or 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
// Simplified config file | |
const path = require('path'); | |
const junitOutput = process.env.CIRCLE_TEST_REPORTS || 'junit' | |
module.exports = function (config) { | |
config.set({ | |
port: 9876, | |
logLevel: config.LOG_INFO, | |
browsers: ['PhantomJS'], | |
frameworks: ['jasmine', 'sinon', 'browserify'], | |
reporters: ['spec'], | |
files: [{ | |
pattern: 'tests.webpack.js' | |
}], | |
preprocessors: { | |
'tests.webpack.js': ['webpack', 'sourcemap'] | |
} | |
}); | |
}; |
This file contains hidden or 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
(function() { | |
// require all modules ending in ".test.js" from the | |
// current directory and all subdirectories | |
var specs = require.context('./app', true, /\.spec\.js$/), | |
actions = require.context('./app/actions', true, /\.js$/), | |
components = require.context('./app/components', true, /\.js$/), | |
containers = require.context('./app/containers', true, /\.js$/), | |
reducers = require.context('./app/reducers', true, /\.js$/), | |
utils = require.context('./app/utils', true, /\.js$/); | |
[ | |
specs, | |
actions, | |
components, | |
containers, | |
reducers, | |
utils | |
].forEach(function(type) { | |
type.keys().forEach(type); | |
}); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment