Closed danielzen closed 9 years ago
It seems like my whole problem came down to the line in karma.conf.js (not shown in my original question:
preprocessors: {
'**/*.js': ['commonjs']
},
For some reason, jasmine.js
is not happy being pre-processed by commonjs, and "*/.js" says to go through all subdirectories (which is probably overkill), including node_modules which has jasmine-core/jasmine.js
So I can either make my pre-processor more specific (best practice):
preprocessors: {
'spec/*.js': ['commonjs'],
'js/*.js': ['commonjs']
},
but as a test to see if any other files would give me a problem, I tried:
preprocessors: {
'**/!(jasmine).js': ['commonjs'],
},
And, everything worked as well. Bottom line. Do not process jasmine.js through commonjs preprocessor!
I know that you say "For an example project, check out Karma's client tests."
I was trying to create an extremely simple example with a minimum configuration. But I am getting an error
in the Jasmine2 library. I have put more detail at StackOverflow, but I would be remiss if I didn't ask here... Any help much appreciated, and would be glad to add to examples.