각도 응용 프로그램을 테스트 할 수 있도록 Intern.io를 설정하려고합니다. 나는 Grunt and Bower도 사용하고 있습니다. 나는 barebones가 자동으로 테스트를 실행하는 작업을 보게하려고 노력하고 있습니다. 내 문제는 내가 테스트를 실행하려고 나는 다음과 같은 오류 메시지가 있습니다 :각과 intern.io가 함께 작동 함
// Learn more about configuring this file at <https://github.com/theintern/intern/wiki/Configuring-Intern>.
// These default settings work OK for most people. The options that *must* be changed below are the
// packages, suites, excludeInstrumentation, and (if you want functional tests) functionalSuites.
define({
// The port on which the instrumenting proxy will listen
proxyPort: 9000,
// A fully qualified URL to the Intern proxy
proxyUrl: 'http://localhost:9000/',
// Default desired capabilities for all environments. Individual capabilities can be overridden by any of the
// specified browser environments in the `environments` array below as well. See
// https://code.google.com/p/selenium/wiki/DesiredCapabilities for standard Selenium capabilities and
// https://saucelabs.com/docs/additional-config#desired-capabilities for Sauce Labs capabilities.
// Note that the `build` capability will be filled in with the current commit ID from the Travis CI environment
// automatically
capabilities: {
'selenium-version': '2.41.0'
},
// Browsers to run integration testing against. Note that version numbers must be strings if used with Sauce
// OnDemand. Options that will be permutated are browserName, version, platform, and platformVersion; any other
// capabilities options specified for an environment will be copied as-is
environments: [
{ browserName: 'internet explorer', version: '11', platform: 'Windows 8.1' },
{ browserName: 'internet explorer', version: '10', platform: 'Windows 8' },
{ browserName: 'internet explorer', version: '9', platform: 'Windows 7' },
{ browserName: 'firefox', version: '28', platform: [ 'OS X 10.9', 'Windows 7', 'Linux' ] },
{ browserName: 'chrome', version: '34', platform: [ 'OS X 10.9', 'Windows 7', 'Linux' ] },
{ browserName: 'safari', version: '6', platform: 'OS X 10.8' },
{ browserName: 'safari', version: '7', platform: 'OS X 10.9' }
],
// Maximum number of simultaneous integration tests that should be executed on the remote WebDriver service
maxConcurrency: 3,
// Name of the tunnel class to use for WebDriver tests
tunnel: 'SauceLabsTunnel',
// The desired AMD loader to use when running unit tests (client.html/client.js). Omit to use the default Dojo
// loader
// useLoader: {
// 'host-node': 'dojo/dojo',
// 'host-browser': 'node_modules/dojo/dojo.js'
// },
// Configuration options for the module loader; any AMD configuration options supported by the specified AMD loader
// can be used here
loader: {
packages: [
{ name: 'angular', location: 'vendor/src/angular/angular' },
{ name: 'angular-mocks', location: 'vendor/src/angular/angular-mocks' }
]
},
// Non-functional test suite(s) to run in each browser
suites: [ 'src/app.test.js' ],
// Functional test suite(s) to run in each browser once non-functional tests are completed
functionalSuites: [ /* 'myPackage/tests/functional' */ ],
// A regular expression matching URLs to files that should not be included in code coverage analysis
excludeInstrumentation: /^node_modules/
});
:
여기
angular.module('ngNomi', [
])
.config(function myAppConfig() {
})
.run(function run() {
})
.controller('AppCtrl', function AppCtrl ($scope, $location) {
});
내 intern.js 파일입니다 같은
Running "intern:app" (intern) task
ReferenceError: window is not defined
at /Users/evanvandegriff/Documents/work/nomi_v2/nomi_v2/web/vendor/src/angular/angular.js:19288:3
at Function.vm.runInThisContext (/Users/evanvandegriff/Documents/work/nomi_v2/nomi_v2/web/node_modules/intern/node_modules/istanbul/lib/hook.js:163:16)
at /Users/evanvandegriff/Documents/work/nomi_v2/nomi_v2/web/node_modules/intern/node_modules/dojo/dojo.js:760:8
at fs.js:271:14
at Object.oncomplete (fs.js:107:15)
Warning: ReferenceError: window is not defined
at /Users/evanvandegriff/Documents/work/nomi_v2/nomi_v2/web/vendor/src/angular/angular.js:19288:3
at Function.vm.runInThisContext (/Users/evanvandegriff/Documents/work/nomi_v2/nomi_v2/web/node_modules/intern/node_modules/istanbul/lib/hook.js:163:16)
at /Users/evanvandegriff/Documents/work/nomi_v2/nomi_v2/web/node_modules/intern/node_modules/dojo/dojo.js:760:8
at fs.js:271:14
at Object.oncomplete (fs.js:107:15) Use --force to continue.
내 app.js
보인다기본적으로 테스트를 실행할 때 해당 파일에 창을 정의하려면 어떻게해야합니까?
라인 24699 분명히 :}) (window, document); 그래서 iffy로 보내지는 윈도우 컨텍스트를 기대하고 있고, node.js 컨텍스트에 윈도우가 없다. – httpete
타일에 "intern.js"라고 쓰여진 것 같아요. @Evan – httpete