我有两个TypeScript包,其中一个包(包A)取决于另一个包(包B)。每个包都有一个使用Karma建立的单元测试。在安装了来自NPM的所有依赖项之后,当我为每个单元单独运行单元测试时,单元测试运行良好。但是,如果我在包A中使用npm link package-b并运行Package的单元测试,那么我就会得到标题中指出的错误:"TS2322: Type 'Timeout‘不能分配到输入’number‘。“
所讨论的行是对setTimeout的调用。在深入研究之后,我发现在不使用npm link的情况下分别运行测试时,TypeScript正确地将typescript/lib/l
我有一个React函数组件,TitleBar,我正尝试用Jest对它进行单元测试。
当我从本地文件导入组件时,测试运行正常。
import [TitleBarProps, default as TitleBar} from './TitleBar.tsx'
但是当我使用以下命令从npm包导入相同的文件时
import [TitleBarProps, default as TitleBar} from 'my-title-bar'
我得到这个错误..。
Invariant Violation: Element type is invalid: expected a
我的单元测试有问题,但我不知道原因。当我在eclipse中正常运行我的单元测试时,它运行的非常好。但是当我尝试使用ant构建我的项目时,有一个单元测试失败了。
我得到的唯一信息是测试失败了,我不知道为什么或者在哪条线上。
有没有办法让蚂蚁告诉我哪里出了问题(在哪条线上)?
这是我的单元测试目标:
<target name="unit.test"
depends="jar"
description="'jar', 'compile', and run unit tests
因此,我在核心数据中添加了一些项,其中包含一个Date字段。我有一个方法可以检索当前周的所有数据。
我的问题是如何对这个单元进行测试?
给定的数据在测试时应始终正常工作。它不应该取决于测试运行的日期。
例如,现在我的数据如下所示:
// Given
1. add item with Date = today
2. add item with Date = today - 1
3. add item with Date = today - 4
// When
Get items count
// Then
XCTAssertTrue(count == 3)
当单元测试在星期五
我一直在写一份“棱角2/打字本”的申请书。最初,我的应用程序和单元测试运行良好。但现在,当我运行单元测试时,会出现错误。
Can't bind to 'closeOnSelect' since it isn't a known property of 'select'. ("label required">Versions</label>
<select soho-dropdown noSearch name="versions" multiple [ERROR ->
发行:
我们在Jenkins中运行NightWatch测试,偶尔会得到以下错误:
[0;31mConnection refused! Is selenium server started?
[0m[0;90m{ Error: socket hang up
at createHangUpError (_http_client.js:253:15)
at Socket.socketCloseListener (_http_client.js:285:23)
at emitOne (events.js:101:20)
at Socket.emit (events.js
我在macOS上运行了一个Cocoa应用程序的Xcode单元测试。当单元测试运行时,我想将一些数据保存到应用程序的项目文件夹中,以便下次测试运行时可以读取它(我正在尝试使用这个)。
但是,试图创建输出目录的尝试失败,出现了一个拒绝权限的错误:
Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “TestOutput”
in the folder “__Snapshots__”."
UserInfo={NSFilePath=/Users/test/code/T
我已经建立了一个模型,我想在Ember中进行单元测试,但每次我运行测试套件时,无论我做什么,我都会得到0个测试运行。
$ ember test
version: 1.13.1
Built project successfully. Stored in "/Users/BenAMorgan/Sites/frontend/tmp/class-tests_dist-pjaTeNtp.tmp".
1..0
# tests 0
# pass 0
# fail 0
# ok
No tests were run, please check whether any errors occ
我创建了一个示例应用程序,其中包含一个非常简单的实体"stock“,其中包含一个字符串id。所有预构建和单元测试运行时都没有错误,但是当我打开生成的应用程序时,我无法看到允许我创建或查看“股票”的对话框。只有页眉和页脚。
我看到的唯一警告是这个:
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
'bower' is
我正试图在我的gitlab服务器上启动一个节点服务器。我已经设置了我的gitlab-ci.yml文件,看起来一切正常。但是,我想在测试运行完成后终止节点服务器。
我的gitlab-ci.yml文件的相关部分如下所示:
unit_tests:
stage: test
variables:
GIT_STRATEGY: clone
script:
- npm install
- npm run websocket-server
- npm test
after_script:
- //what should go here to kill