I am trying to test an angular app using Jasmine-Karma. I am new to the "testing / console / npm" field, so I would like to ask you to give an easy explanation (and some correction) that causes the error.
Untrained ReferenceError: require is not defined in /Applications/MAMP/HTDOCS/..../ node_modules / angular -mocks / ngAnimateMock.js: 1
I also found out that ngAnimateMock.js is missing in the angular -mocks folder.
Here is my karma.conf.js file
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine'],
files: [
'public/vendor/angular/angular.js',
'node_modules/angular-mocks/*.js',
'public/vendor/traceur/bin/traceur.js',
'public/js/*.js',
'test/spec/spec.js',
],
exclude: [
],
preprocessors: {
},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
source
share