问题标签 [karma-runner]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ember.js - Using EmberJS, Mocha and Karma
I am using Mocha and Karma for writing and running test cases for my emberjs client. I bundle all my test cases as a single file and using minispade.js to solve the dependency issues
The problem which I am facing is that, I am able to run the test cases, but if a test case fails, it only shows the description of the test case and does not provide any info about the file which has the case written.
Is there any way to show the file name also, if any test case fails?
angularjs - 在 AngularJS 教程中运行测试时出错,步骤 3
尝试在角度教程( http://docs.angularjs.org/tutorial/step_03 )中运行端到端测试时,我得到以下信息......
我做了“git checkout -f step-3”所以它直接来自回购......
我在 Rails 应用程序中运行该应用程序,该应用程序由 WEBrick 在端口 3000 上提供服务。所以我将 testacula 配置更改为...
...然后测试运行但失败
所以它似乎没有正确导航到页面。有人有想法么?
干杯
service - AngularJS 使用 $http 和 $q 测试服务
我是 AngularJS 和一般 JS 测试的新手,我在思考如何测试这个相当简单的服务时遇到了麻烦。我尝试在变体配置中使用 $httpBackend 和 'when' 和 'expect' GET,但无济于事。测试应验证 1) 数据通过 deferred.resolve 返回,2) 没有数据通过 deferred.reject 返回。如果有人能指出我正确的方向,我将不胜感激。谢谢!
顺便说一句:我正在使用 Jasmine + Testacular
javascript - 测试定义为 angular.module('myApp').controller(
我正在玩https://github.com/angular/angular-seed
在 app/controllers.js 中定义了一个控制器,如下所示
这不会通过 jshint,因为在 app/app.js 中引用了 MyCtrl1 而不是在我的全局列表中。
根据布赖恩福特和其他人的说法,我读过的首选风格是
我更喜欢这个,因为它不在全局范围内,但现在我的睾丸规格失败了,因为它不再起作用了:
为了测试目的,我如何获取以“首选”样式定义的此控制器的引用?
angularjs - $emit 在使用 testacular (karma) 时会产生错误
这很可能是我不知道如何使用 Karma。假设我有一个像这样的 angularJS 样板测试
如果我像这样在我的控制器中插入一个 $emit
我的测试现在失败并说
何帮助深表感谢!angularjs - 使用 testacular(现为 karma)在浏览器中调试
当我破坏单元测试时,我试图找出调试单元测试的最佳方法。通常在以前的测试环境中,我可以只在浏览器中运行测试,然后对测试或代码进行断点,然后查看测试失败的原因。我似乎无法弄清楚如何用睾丸来做到这一点。有没有一种简单的方法来调试单元测试?
testing - Jasmine/Karma 测试:未定义浏览器
如果这个测试:
包括该"browser"
行,结果是:
但如果没有这条线,测试就会成功。
人们建议包括angular-scenario.js
,但这会破坏测试
被评估为真。
该怎么办?
jenkins - Jenkins 没有从文件中输出 Junit 报告信息
问题
Jenkins 未获取 junit 格式的报告,导致报告未列在项目的状态屏幕中。
细节
junit 格式的报告数据由名为 Karma-runner(以前称为 Testacular)的测试框架生成。被忽略的文件是在与创建/target/surefire-reports
surefire 生成的报告的位置相同的位置创建的。报告数据看起来与 maven surefire 插件生成的数据几乎相同,只是它的父元素<testsuites>
不是<testsuite>
--<testsuite>
是surefire 生成的报告作为报告文件的父元素所具有的内容。这是 karma 生成的 junit 格式报告的片段,名为TEST-karma.resultsTest.xml
:
Junit 格式的 Karma 生成的报告文件,TEST-karma.resultsTest.xml
Karma 测试在我的 Maven 构建的测试阶段运行。我已经尝试创建只生成这个 junit-report 文件的项目以及运行构建,以便所有 junit 测试和业力测试生成报告文件。詹金斯总是会选择万无一失的测试,但绝不会选择业力测试。
感谢您的任何意见!
angularjs - 您如何使用 Karma Runner(又名 Testacular)提供 svg 和固定装置
在过去的两个小时里,我一直在尝试让 Karma runner 提供一个 svg 文件和一个 html 固定装置,但到目前为止还没有运气。
在此线程上的第二个答案之后:将 html 与 testacularjs 集成时出错我一直在尝试使用served
来指示我的固定装置和 svg 文件应该由服务器分发,但我仍然收到“未找到”
我正在设置jasmine.getFixtures().fixturesPath
to /fixtures
,我可以看到它使用了正确的路径,但我仍然最终......
GET http://localhost:9876/img/svg/directional-pad-gradients.svg 404 (Not Found)
GET http://localhost:9876/fixtures/directional-pad.html 404 (Not Found)
如果有人有使用 Karma runner 加载固定装置和/或 svg 的示例,我真的很想看看。谢谢!
node.js - 安装 Karma (Testacular) 时出错
我的机器上运行了 v0.8.18 版本的节点,我正在尝试安装 Karma (Testacular),但不断收到以下错误。我无法理解错误,有没有人遇到过这个或知道缺少什么?