Tag: karma runner

模块没有在业力中定义

我想在WebStorm 7中使用业力运行mySpec.js。当我运行业力,业力服务器启动我的浏览器,但在WebStorm我面临这个错误: 这是我得到的错误 ReferenceError:模块没有在null处定义。 (C:/Users/Babar/Desktop/angular/test/basic/mySpec.js:2:16)在C:/Users/Babar/Desktop/angular/test/basic/mySpec.js:1:1过程完成退出代码0 这里是我的configuration文件: // Karma configuration // Generated on Thu Nov 21 2013 03:05:08 GMT-0800 (Pacific Standard Time) module.exports = function (config) { config.set({ // base path, that will be used to resolve files and exclude basePath: '', // frameworks to use frameworks: ['jasmine'], // list of files / patterns to load […]

警告:运行grunttesting时没有find任务“业力”

Kickstart Your AngularJS Development with Yeoman, Grunt and Bower 在遵循这个关于Angular,Yeoman,Bower和Grunt的有趣的指南之后,我能够引导一个Angular应用程序。 一切工作正常,除了与噶的testing。 当我运行: grunt test 我得到以下错误: Warning: Task "karma" not found. Used –force, continuing. Done, but with warnings 我检查了是否已经安装了Karma,但是已经安装了。 对于Grunt来说,你似乎需要安装grunt-karma。 所以我试着通过下面的命令: npm install grunt-karma –save-dev 这给了我错误,如: errno: 53, code: 'ENOTEMPTY', path: 'C:\\tmp\\phantomjs\\phantom-1.9.2-windows-.zip-extract-' .. 我在Windows上,并执行从PowerShell的命令。 希望有人能帮忙。 编辑karma.conf.js和gruntfile // Karma configuration // http://karma-runner.github.io/0.10/config/configuration-file.html module.exports = function(config) { config.set({ […]

如何在Jenkins上运行AngularJS端到端testing?

我如何在Jenkins上运行AngularJS 端到端testing? 据我所知,e2etesting需要一个Web服务器。 我可以在运行node.js Web服务器脚本的同时在本地运行e2etesting。

React的TestUtils.Simulate.keyDown不起作用

我的应用程序中有很多组件响应不同的按键,到目前为止,我的testing都没有使用TestUtils.Simulate.keyDown 。 看起来像keyDown只是简单而简单的不起作用。 这是我正在testing的组件: description.js var React = require('react/addons'); var Description = React.createClass({ render : function () { return ( <div className="description"> <input type="text" ref="input"/> </div> ) } }); module.exports = Description; 这是一个简单的testing失败: 描述-test.js var React = require('react/addons'); var TestUtils = React.addons.TestUtils; var expect = require('expect'); var Description = require('../description'); describe('Description', function () { it('updates […]

在使用Karma和伊斯坦布尔时不包括覆盖范围内的文件

我使用Karma来testing我的JavaScript并获得覆盖率报告。 我正在使用伊斯坦布尔的覆盖报告,这是默认的。 这是我的预处理器参数: preprocessors: { 'framework/**/*.js':'coverage', 'framework/*.js':'coverage', '!framework/node/**/*.js':'coverage', '!framework/test/**/*.js':'coverage', 'framework-lib/**/*.js':'coverage', '!framework-lib/tool-data-api/tool-data-api.js':'coverage' } 正如你所看到的,我正在尝试使用“!” 作为否定命令,通常与Node一起使用。 然而,这不是在这里工作,没有我的目录被排除在外。 有什么办法可以做我想做的事情吗?

特拉维斯CI:Karmatesting通过,但总是得到错误的构build

我一直在尝试把我的自由源项目中的CI的Travis集成在一起。 当我推送到我的仓库时,一切看起来都不错,但在执行karma start –single-run ,Travis的控制台不会停止执行业力开始任务。 如何解决这个问题? .travis.yml language: node_js sudo: false node_js: – 0.10 script: karma start -–single-run before_install: – export DISPLAY=:99.0 – sh -e /etc/init.d/xvfb start before_script: – npm install -g bower – npm install – bower install 特拉维斯控制台 更新问题 :为什么在Travis过程中,当我在控制台中使用karma start –single-run选项no覆盖选项singleRun:false在karma.conf.js中? 在我的本地环境中,这工作正常。

Karma无法捕获PhantomJS

我们已经build立了一个运行Karma目标PhantomJS的Jenkins CI服务器。 我们正在通过Grunt运行我们的testing。 Jenkins,Grunt和Phantom都运行正常,Karma似乎很好,但Karma无法捕捉到Phantom。 我们的脚本在本地运行(OSX)就好了。 通过bash或Jenkins运行同样的错误: Running "karma:jenkins-unit" (karma) task [2013-07-03 11:03:12.168] [WARN] config – urlRoot normalized to "/__karma/" DEBUG [reporter]: Using reporter "dots". DEBUG [reporter]: Using reporter "junit". DEBUG [reporter]: Using reporter "coverage". INFO [karma]: Karma server started at http://localhost:8084/__karma/ INFO [launcher]: Starting browser PhantomJS DEBUG [launcher]: Creating temp dir at /tmp/testacular-7720703 DEBUG [launcher]: […]

在启动时打开Karma debug.html页面

简短版本: 我该如何启动Karma并让它在Karma开始页面的同一浏览器中自动打开debug.html文件? 长版: 我不是使用控制台记者噶的一个巨大的风扇,所以我一直在使用Karma的本地主机:9876 / debug.html文件输出karma茉莉花-html记者,livereload 。 问题是,每次我开始一个debugging会话,我必须点击业务打开的网页中的“debugging”button。 我想find一个方法来让业力通过一个吞噬任务自动打开debug.html页面。 我在多个浏览器中运行testing,因此我希望打开debug.html页面作为Karma打开的每个浏览器的第二个选项卡。 我也想在closureskarma时closuresdebug.html选项卡。 我尝试了一堆东西,没有成功。 这是我的g task任务。 'watch'任务监视我的源脚本TypeScript文件,并将它们编译成javascript …没有任何幻想。 gulp.task('watch-test', ['watch'], function (done) { //start a livereload server so that the karma html //reporter knows to reload whenever the scripts change livereload.listen(35729); gulp.watch('dist/src/**/*.js').on('change', livereload.changed); new KarmaServer({ configFile: __dirname + '/karma.conf.js', singleRun: false }, done).start(); });

与Sinon一起testingaxios调用,还有redux和Karma

你好在testing的redux文档中,他们有这个例子来testingAPI调用: import configureMockStore from 'redux-mock-store' import thunk from 'redux-thunk' import * as actions from '../../actions/counter' import * as types from '../../constants/ActionTypes' import nock from 'nock' const middlewares = [ thunk ] const mockStore = configureMockStore(middlewares) describe('async actions', () => { afterEach(() => { nock.cleanAll() }) it('creates FETCH_TODOS_SUCCESS when fetching todos has been done', (done) => […]

在npm install命令中出错

在npm install命令结束时出现错误。 angular#1.2.1 bower_components\angular npm ERR! peerinvalid The package karma-requirejs does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer karma@0.10.10 wants karma-requirejs@~0.2.0 npm ERR! System Windows_NT 6.1.7600 npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" npm ERR! cwd F:\AngularExamples\KarmaTest546\AngularJS-Testing-Article npm ERR! node -v v0.10.28 npm ERR! npm -v 1.4.9 npm ERR! code […]