@adaliszk/typescript-testing 中文文档教程
用于使用 Jest 测试 Typescript 的元包
Provides
@testdeck/jest
jest
&ts-jest
chai
Usage
- Install the package
yarn add -D @adaliszk/typescript-jest
- Add a jest config with:
{
"rootDir": ".",
"testRegex": ".(spec|test).ts$",
"transform": {
".*\\.ts$": "ts-jest"
},
"testEnvironment": "node",
"preset": "ts-jest"
}
- Add a script to run jest:
"test": "jest"
此外,这个包是所提供包的外观,其中每个导出都在默认输出上可用,或者 您可以将它们用作命名空间,例如 testdeck
和 chai
。
Versioning
由于这是一个元包,版本控制反映了它提供的主要包,在本例中为 jest
。 然而,只有 主要版本和次要版本保持同步。 补丁用于修改元包。
Meta-Package for testing Typescript with Jest
Provides
@testdeck/jest
jest
&ts-jest
chai
Usage
- Install the package
yarn add -D @adaliszk/typescript-jest
- Add a jest config with:
{
"rootDir": ".",
"testRegex": ".(spec|test).ts$",
"transform": {
".*\\.ts$": "ts-jest"
},
"testEnvironment": "node",
"preset": "ts-jest"
}
- Add a script to run jest:
"test": "jest"
Furthermore, this package is a facade for the provided packages where each export is available on the default output, or you can use them as namespace like testdeck
and chai
.
Versioning
Since this is a meta-package, the versioning reflect its main provided package, in this case jest
. However, only the Major and Minor versions are kept in sync. The Patch is used to bump the meta-package.