Created
November 22, 2013 17:28
-
-
Save vojtajina/7603741 to your computer and use it in GitHub Desktop.
Karma config helpers example
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
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}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@vojtajina Thank you for the example!