Skip to content

Instantly share code, notes, and snippets.

@vojtajina
Created November 22, 2013 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vojtajina/7603741 to your computer and use it in GitHub Desktop.
Save vojtajina/7603741 to your computer and use it in GitHub Desktop.
Karma config helpers example
var served = function(file) {
return {pattern: file, included: false};
};
var included = function(file) {
return {pattern: file, included: true};
};
module.exports = function(config) {
config.set({
files: [
served('lib/knockout.js'),
served('src/*.js'),
included('test/main.js')
]
});
};
// Or more RequireJS specific:
module.exports = function(config) {
config.set({
requiredFiles: [
'lib/knockout.js',
'src/*.js'
],
mainFile: 'test/main.js'
});
// You can extract this into a moduel and require('...') it.
config.requiredFiles.forEach(function(pattern) {
config.files.push({pattern: pattern, included: false});
});
config.files.push({pattern: config.mainFile, included: true});
};
@kvervo
Copy link

kvervo commented Dec 13, 2013

@vojtajina Thank you for the example!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment