为什么我在开始测试的时候会有一个角度内的误差?

时间:2022-02-22 22:56:03

Than I add this:

比我添加这个:

beforeEach(module('tabQuestionsApp'));

inside derictive test I has an error:

内部测试我有一个错误:

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

“C:\ Program Files \ nodejs \节点。exe”C:\Users\ tek.WebIde80 \ config \ plugins \ js-karma \ js_reporter \ karma-intellij \ lib \ intellijRunner。js - karmaPackageDir = C:\ \ tek \ AppData \漫游用户\ npm \ node_modules \业力serverPort = 8080——urlRoot = /

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

minErr / < @D:/ OpenServer /域/项目/ web / js / app / scripts / appcrm / tab_questions /资源/角度/角。js:78:12 loadmodule / < @D:/ OpenServer /域/项目/ web / js / app / scripts / appcrm / tab_questions /资源/角度/角。js:3906:15 forEach@D:/ OpenServer /域/项目/ web / js / app / scripts / appcrm / tab_questions /资源/角度/角。js:325:9 loadModules@D:/ OpenServer /域/项目/ web / js / app / scripts / appcrm / tab_questions /资源/角度/角。js:3872:5 createInjector@D:/ OpenServer /域/项目/ web / js / app / scripts / appcrm / tab_questions /资源/角度/角。js:3812:11 workFn@D:/ OpenServer /域/项目/ web / js / app / scripts / appcrm / tab_questions /资源/ angular-mocks / angular-mocks.js:2244:46

Process finished with exit code 0

进程完成与退出代码0

my app - init:

我的应用——初始化:

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

karma included files:

业力包括文件:

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'

     ],

1 个解决方案

#1


0  

You need to pass function as argument to beforeEach:

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

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

#1


0  

You need to pass function as argument to beforeEach:

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

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