为什么我在开始测试时出现了内部角度错误

Why I had an error, inside angular when I start the test?

本文关键字:内部 错误 开始 测试 为什么      更新时间:2023-09-26

然后我加上这个:

beforeEach(module('tabQuestionsApp'));

内部嘲笑测试我有一个错误:

"C:''Program Files''nodejs''node.exe"C:''Users''tek.WebIde80''config''plugins''js karma''js_reporter''akarma intellij''lib''intellijRunner.js--karmaPackageDir=C:''Users''tek''AppData''Roaming''npm''node_modules''akarma--serverPort=8080--urlRoot=/

minErr/<D:/OOpenServer/domains/project/web/js/appcrm/tab_questions/app/scripts/resources/angular/angular.js:78:12loadModules/<D:/OOpenServer/domains/project/web/js/appcrm/tab_questions/app/scripts/resources/angular/angular.js:3906:15forEach@D:/OOpenServer/domains/project/web/js/appcrm/tab_questions/app/scripts/resources/angular/angular.js:325:9loadModules@D:/OOpenServer/domains/project/web/js/appcrm/tab_questions/app/scripts/resources/angular/angular.js:3872:5createInjector@D:/OOpenServer/domains/project/web/js/appcrm/tab_questions/app/scripts/resources/angular/angular.js:3812:11workFn@D:/OOpenServer/domains/project/web/js/appcrm/tab_questions/app/scripts/resources/angular mocks/angular mocks.js:2244:46

进程已完成,退出代码为0

我的应用程序-init:

angular.module('tabQuestionsApp', ['ngSelectable','angularFileUpload','ngCkeditor','ngSanitize']);

因果报应包含的文件:

files: [
  'app/scripts/resources/ng-file-upload-shim/angular-file-upload-shim.min.js',
  'app/scripts/resources/angular/angular.js',
  'app/scripts/resources/angular-mocks/angular-mocks.js',
  'app/scripts/resources/ng-file-upload/angular-file-upload.min.js',
  'app/scripts/resources/ng-ckeditor/ng-ckeditor.js',
  'app/scripts/resources/angular-sanitize/angular-sanitize.js',
  'app/scripts/resources/lodash/dist/lodash.js',
  'app/scripts/resources/ngSelectable/src/ngSelectable.js',
  'app/views/*.html',
  'app/scripts/app.js',
  'app/scripts/directives/tagSearch.js',
  'test/spec/directives/tagSearch.js'
     ],

您需要将函数作为参数传递给beforeEach:

beforeEach(function(){
    module('yourModuleName');
})