Skip to content

Commit db3c7b6

Browse files
authored
Merge pull request #3173 from strongloop/fix/strong-remoting-in-karma
Fix Karma config to babelify node_modules too
2 parents 76dd35e + 3c209ee commit db3c7b6

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

test/karma.conf.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,32 @@ module.exports = function(config) {
105105
'supertest',
106106
],
107107
transform: [
108-
['babelify', {presets: 'es2015'}],
108+
['babelify', {
109+
presets: 'es2015',
110+
// By default, browserify does not transform node_modules
111+
// As a result, our dependencies like strong-remoting and juggler
112+
// are kept in original ES6 form that does not work in PhantomJS
113+
global: true,
114+
// Prevent SyntaxError in strong-task-emitter:
115+
// strong-task-emitter/lib/task.js (83:4):
116+
// arguments is a reserved word in strict mode
117+
// Prevent TypeError in chai:
118+
// 'caller', 'callee', and 'arguments' properties may not be
119+
// accessed on strict mode functions or the arguments objects
120+
// for calls to them
121+
// Prevent TypeError in loopback-datasource-juggler:
122+
// 'caller', 'callee', and 'arguments' properties may not be
123+
// accessed on strict mode functions or the arguments objects
124+
// for calls to them
125+
ignore: /node_modules\/(strong-task-emitter|chai|loopback-datasource-juggler)\//,
126+
}],
109127
],
110128
debug: true,
111129
// noParse: ['jquery'],
112130
watch: true,
113131
},
114132

115133
// Add browserify to preprocessors
116-
preprocessors: {'test/*': ['browserify']},
134+
preprocessors: {'test/**/*.js': ['browserify']},
117135
});
118136
};

0 commit comments

Comments
 (0)