Chutzpah:ReferenceError:找不到变量:角度

时间:2019-03-03 05:28:24

标签: angularjs unit-testing visual-studio-2017 chutzpah

我有一个Chutzpah设置,似乎不想正确加载。如果将项目重新加载到Visual Studio(2017)中并导航到测试资源管理器,我会看到许多有关未正确设置引用的错误。我希望基于它们在chutzpah.json文件中存在的顺序,它们的依赖项将得到正确处理。但是我收到以下错误(以及其他错误):

[3/3/2019 12:08:28 AM Error] Error: ReferenceError: Can't find variable: angular
    [{file:file:///c:/source/orgbuilder/web/bcg.fse.orgbuilder.web/scripts/libraries/angularaddons/ui-grid.js,line:9,function:}]
While Running:c:\source\orgbuilder\web\bcg.fse.orgbuilder.web\scripts\libraries\angularaddons\ui-grid.js

从我看到的内容来看,ui-grid.js肯定是在angular.js之后加载的。为什么我会看到此错误。我尝试了一百种不同的配置来尝试解决此问题,但是遇到了麻烦。任何帮助将不胜感激,试图解决这个问题。以下是我们使用(经过清理)的chutzpah.json文件。

{
  "TestHarnessLocationMode": "SettingsFileAdjacent",
  "RootReferencePathMode": "SettingsFileDirectory",
  "TestFileTimeout": 200000,
  "Tests": [
    {
      "Path": "./",
      "Include": "*Spec.js"
    }
  ],
  "References": [
    { "Path": "moduleTestSetup.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/jQuery/jquery-3.3.1.min.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/angularjs/angular.min.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/angularjs/angular-route.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/angularjs/angular-mocks.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/angularjs/angular-animate.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/angularjs/angular-sanitize.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/Angular.UI.Bootstrap/Scripts/ui-bootstrap-tpls.min.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/jQuery.UI.Combined/Content/Scripts/jquery-ui-1.12.1.min.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/JSNLog/Scripts/jsnlog.min.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/KendoUI/js/kendo.all.min.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/underscore.js/underscore.min.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/gsklee.ngStorage/ngStorage.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/numeral/numeral.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/Moment.js/moment-with-locales.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/AngularAddons/angular-clickout.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/AngularAddons/jsnlogToServer.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/AngularAddons/sx-wizard.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/AngularAddons/sx-wizard-tpls.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/AngularAddons/ui-grid.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/AngularAddons/angular-clickout.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/AngularAddons/ui-sortable.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/AngularAddons/ui.sortable.multiselection.js" },
    {
      "Path": "../../../Web/Project/Scripts/App",
      "Includes": [ "**.js" ],
      "Excludes": [ "*MainApp.js", "*LoginApp.js" ]
    },
    { "Path": "../../../Web/Project/Scripts/Libraries/AngularAddons/angular-recursion.js" },
    { "Path": "../../../Web/Project/Scripts/Libraries/AngularAddons/indeterminate.js" }
  ],
  "CodeCoverageIncludes": [ "*Admin*Controller.js", "*Admin*Directive.js" ],
  "CodeCoverageSuccessPercentage": 60,
  "CodeCoverageExecutionMode": "Never",
  "CodeCoverageTimeout": 200000,
  "Transforms": [
      { "Name": "jacoco", "Path": "coverage.xml" }
    ],
  "IgnoreResourceLoadingErrors": false
}

感谢您的帮助!

0 个答案:

没有答案