angularjs - Error during Karma Test execution -
i have problem current directives build following :
selectprice.directive.js file
(function() { 'use strict';
angular .module('app.buyouts.selectprice') .directive('selectprice', selectprice);
however when starting karma, following error:
chrome 54.0.2840 (windows 7 0.0.0) error uncaught referenceerror: angular not defined @ app/buyouts/selectprice/selectprice.directive.js:5
i don't know do. maybe directives aren't created properly? can u please help.
you need add angular karma.config.js
example:
module.exports = function(config) { config.set({ // base path, used resolve files , exclude basepath: '../..', frameworks: [ 'mocha' , 'chai' ], // list of files / patterns load in browser files: [ 'assets/libs/angular.min.js', 'assets/libs/angular-cookies.min.js', 'assets/libs/angular-route.min.js', 'assets/libs/angular-sanitize.min.js', 'assets/libs/angular-mocks/angular-mocks.js', 'test/unit/components/*.test.js' ]
Comments
Post a Comment