我在用因果报应做我的天使测试。当我运行npm test时,会执行我的测试,但随后浏览器会关闭。我已经用Chrome,PhantomJS,Safari和火狐进行了测试。这是我的karma.conf.js。
// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files a
当我运行测试用例时,我得到了这个错误:
Error: [ng:areq] Argument 'testcont' is not a function, got undefined
这是我的ControllerSpec.js
describe('controllers', function(){
var scope;
beforeEach(angular.module('myapp.test'));
beforeEach(inject(function($controller, $rootScope){
sc
我们所有的业力单元测试似乎在我们的自动化构建中都成功了,但是PhantomJS运行程序将一个非零的结果返回到构建框架(TeamCity)。我在日志中唯一能找到的错误是:
[17:53:31][JavaScript Unit Tests] PhantomJS 2.1.1 (Windows 8.0.0) ERROR
[17:53:31][JavaScript Unit Tests] An error was thrown in afterAll
[17:53:31][JavaScript Unit Tests] SyntaxError: Unexpected token ',
我的项目是离子-天使-要求
我的环境是MacOSX10.10.1,节点v0.10.30
我想将业力测试集成到我的项目中,但这是运行grunt test时的错误
结果:
Running "karma:unit" (karma) task
INFO [karma]: Karma v0.12.28 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.8 (Mac OS X)]: Connected on socket UhgM
每当我运行单元测试时,我都会得到这样的错误:
browser is not defined.
我的配置文件如下所示-有人能建议这个问题吗?
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: './',
// frameworks to use
// available frameworks: https://npmjs.or
所以我决定将单元测试添加到我的NS7/NG11应用程序中,遵循NS网站的说明,并达到了应用程序将启动但屏幕空白(全白)的地步。 使用ns test init进行了初始化测试,手动将package.json中的karma-webpack更新为v 5.0.0-alpha.5,默认情况下有一个已修复的错误,应该很快就会发布。 用于启动测试的命令为:ns test run --emulator 在Tabs模板中使用Angular进行测试。当运行ns run ios --emulator时,运行得很好,并且是可用的。 下面是我的package.json {
"name": "
我正致力于基本的角度项目,我能够运行与因果报应和贾斯敏在我的Windows无头铬测试。但是Jenkins说No binary for ChromeHeadless browser on your platform,所以问题是如何在Jenkins配置中配置ChromeHeadless。
错误日志
在您的平台上没有用于ChromeHeadless浏览器的二进制文件。请设置CHROME_BIN“envVariable.npm错误!测试失败。
package.json
"devDependencies": {
"@angular-devkit/build-an
现在我得到了:
INFO [karma]: Karma v0.10.2 server started at `http://localhost:9876/`
INFO [launcher]: Starting browser Chrome
INFO [Chrome 30.0.1599(Linux)]: Connected on socket Q8d9RLBQDqi7wJ8iaKNw Chrome 30.0.1599 (Linux)
directives Mydirective directive should render Roi element correctly FAILED
Erro
为了在测试当前运行的问题前缀,但它似乎挂起,它启动浏览器,但不退出浏览器本身,似乎没有在测试中运行代码。我认为它没有运行,因为最终的测试文件没有被浏览器加载,但我不知道为什么。这是我的karma.conf.js
// Generated on Mon Nov 18 2013 01:47:10 GMT-0600 (CST)
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '&
我一直试图从ToT 母版中运行一些测试,并在运行./scripts/e2e-test.sh时继续获得以下错误
TypeError: Property 'browser' of object #<Object> is not a function
当我尝试运行以下代码作为我的e2e场景之一时,会出现此错误:
'use strict';
/* https://github.com/angular/protractor/blob/master/docs/getting-started.md */
describe('MyApp', fu
在我的angular js测试中,我得到了这个错误:
Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:nomod] Module 'app' is not available! You either misspelled the module name or forgot to load it.
尝试为我的服务编写单元测试时,它是这样开始的:
var $httpBackend, httpBasedService;
beforeEach
我从这段视频中学到了
但我不是成功或失败,而是..。
INFO [watcher]: Changed file "/Users/kirk/git/kirkstrobeck/learn-angular/egghead/app/main.js".
Chrome 31.0.1650 (Mac OS X 10.9.0) filter reverse should reverse a string FAILED
RangeError: Maximum call stack size exceeded
at reverseFilter (/Users/kirk/git/ki
我开始学习角,因此想做他们的教程。但是,它只是不加载组件。我就是这样做的:
git克隆快速启动
cd快速启动
npm安装
npm启动
我还没有修改代码,安装也很好,没有任何错误。然而,当启动应用程序时,浏览器只显示“在这里加载AppComponent内容.”而不是预期的"Hello角“。浏览器控制台给出了以下错误:
Error: (SystemJS) in strict mode code, functions may be declared only at top level or immediately within another function
我的应用程序有很多模块,有许多组件和服务以及其他Angular2功能。
现在,我正在尝试使用TestBed方法创建一个带有茉莉花+业力的单元测试。
我在揭示概念的证据时遇到了一个错误。我为我的一个组件创建了一个测试,如下所示:
let myCompServiceStub = {} as MyComponentService;
let routerStub = {} as Router;
let globalServiceStub = {} as MyGlobalService;
describe('MyComponent', () => {
let compo
我已经看了无数次,所以在这个帖子上,但无法让我的角度控制器的单元测试工作。
错误:
TypeError: Object #<Object> has no method 'apply'
Error: [ng:areq] Argument 'CorrMatrixCtrl' is not a function, got undefined
http://errors.angularjs.org/1.2.14/ng/areq?p0=CorrMatrixCtrl&p1=not%20a%20function%2C%20got%20undefined
我使用Karma和Require进行单元测试,我注意到一些奇怪的事情。当连续运行karma 3-4次时,我得到了2-4个套接字连接。
INFO [karma]: Karma v0.12.2 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
WARN [watcher]: Pattern "/Users/mja07/workspace/common-js/test/unit/**/*.mock.js" does not match any file.
INFO