Skip to content

Commit

Permalink
Implement fix for Karma prebundle
Browse files Browse the repository at this point in the history
As described in the GitHub issue[1]. Unfortunately now we fail further
down the stack...

[1]: nikku/karma-browserify#63 (comment)
  • Loading branch information
aron committed Dec 11, 2014
1 parent e505e4a commit a9f5714
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ module.exports = function (karma) {
browserify: {
debug: true,
prebundle: function (bundle) {
// This allows annotator-plugintools to require annotator as
// 'annotator' in the test environment.
bundle.require('./src/annotator', {expose: 'annotator'});
// This, for reasons that remain entirely unclear, fixes an
// issue where the above require doesn't seem to work, and the
// karma build dies saying "Cannot find module 'annotator' ..."
bundle.bundle();
// This is event is fired each time the bundle is built.
bundle.on('reset', function () {
// This allows annotator-plugintools to require annotator
// as 'annotator' in the test environment.
bundle.require('./src/annotator', {expose: 'annotator'});
});
}
},

Expand Down

0 comments on commit a9f5714

Please sign in to comment.