Skip to content

Instantly share code, notes, and snippets.

@chrisfinch
Created August 29, 2013 13:34
Show Gist options
  • Save chrisfinch/6378204 to your computer and use it in GitHub Desktop.
Save chrisfinch/6378204 to your computer and use it in GitHub Desktop.
Karma plugin code for loading a node.js module in to run time.
var path = require('path');
var createPattern = function(path) {
return {pattern: path, included: true, served: true, watched: false};
};
var framework = function(files) {
files.unshift(createPattern(path.resolve(require.resolve('imagediff'), '../imagediff.js')));
};
framework.$inject = ['config.files'];
module.exports = {
'framework:jasmine-imagediff': ['factory', framework]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment