jest-marbles 项目使用教程
1. 项目的目录结构及介绍
jest-marbles/
├── dist/
│ ├── umd/
│ │ └── jest-marbles.js
│ ├── lib/
│ │ └── index.js
│ ├── lib-esm/
│ │ └── index.js
│ └── typings/
│ └── index.d.ts
├── e2e/
│ ├── jest-browser.config.js
│ └── jest-node.config.js
├── package.json
├── README.md
└── src/
└── ...
- dist/: 包含编译后的文件,包括UMD格式、CommonJS格式、ES模块格式以及TypeScript类型定义。
- e2e/: 包含端到端测试的配置文件。
- package.json: 项目的配置文件,包含依赖、脚本等信息。
- README.md: 项目的介绍文档。
- src/: 项目的源代码目录。
2. 项目的启动文件介绍
项目的启动文件位于 dist/umd/jest-marbles.js
,这是一个UMD格式的文件,可以在浏览器和Node.js环境中使用。
3. 项目的配置文件介绍
项目的配置文件是 package.json
,其中包含以下关键配置:
{
"name": "jest-marbles",
"version": "3.1.0",
"description": "Marble testing helpers library for RxJs and Jest",
"main": "dist/umd/jest-marbles.js",
"module": "dist/lib/index.js",
"es2015": "dist/lib-esm/index.js",
"typings": "dist/typings/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/meltedspark/jest-marbles"
},
"author": "Evgeny Barabanov",
"license": "MIT",
"engines": {
"node": ">=18"
},
"keywords": [
"jest",
"marbles",
"marble",
"testing",
"test",
"rxjs",
"observable"
],
"scripts": {
"e2e": "jest --config=e2e/jest-browser.config.js && jest --config=e2e/jest-node.config.js"
}
}
- name: 项目名称。
- version: 项目版本。
- description: 项目描述。
- main: 主入口文件。
- module: ES模块入口文件。
- es2015: ES2015模块入口文件。
- typings: TypeScript类型定义文件。
- repository: 代码仓库信息。
- author: 作者信息。
- license: 许可证信息。
- engines: 支持的Node.js版本。
- keywords: 项目关键词。
- scripts: 脚本命令,如端到端测试命令。
通过以上介绍,您可以更好地理解和使用 jest-marbles
项目。