@3blades/cypress-test-utils 中文文档教程
cypress-test-utils
Organization
代码被组织到三个目录中:
browser/
: this directory contains code that should only be run in a browser contextserver/
: this directory contains code that should only be run in a Node.js contextshared/
: this directory contains code that can be run in both a browser and Node.js context
Tests
这个 repo 使用 jest
进行单元测试。 运行 npm test
以在开发期间以监视模式运行 jest。 npm run test:ci
运行一次单元测试并输出覆盖率信息。
Releases
这个 repo 使用 semantic-release
来处理所有版本。 每次推送到 master
分支时,都会向 GitHub 和 npm 发布一个新版本。 为了帮助维护变更日志、发行说明等,commitizen
用于正确格式化提交消息。 运行 npm run cm
以提交更改。
提交类型
只有某些提交类型会触发发布。 下表描述了哪些类型会触发发布、该类型的任何条件以及触发的发布级别。
Type | Condition | Release |
---|---|---|
any | Breaking change | major |
feat | minor | |
fix | patch | |
perf | patch | |
chore | patch | |
refactor | patch | |
docs | scope set as README | patch |
cypress-test-utils
Organization
Code is organized into three directories:
browser/
: this directory contains code that should only be run in a browser contextserver/
: this directory contains code that should only be run in a Node.js contextshared/
: this directory contains code that can be run in both a browser and Node.js context
Tests
This repo uses jest
for unit tests. Run npm test
to run jest in watch mode during development. npm run test:ci
runs the unit tests once and outputs coverage information.
Releases
This repo uses semantic-release
to handle all releases. On each push to the master
branch, a new release is published to both GitHub and npm. To assist in maintaining changelogs, release notes, etc., commitizen
is used to correctly format commit messages. Run npm run cm
to commit changes.
Commit Types
Only certain commit types will trigger a release. The table below describes which types trigger a release, any conditions for the type, and the level of release that is triggered.
Type | Condition | Release |
---|---|---|
any | Breaking change | major |
feat | minor | |
fix | patch | |
perf | patch | |
chore | patch | |
refactor | patch | |
docs | scope set as README | patch |