@knapsack-pro/jest 5.4.1 → 5.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +97 -102
  2. package/package.json +7 -9
package/README.md CHANGED
@@ -1,46 +1,47 @@
1
1
  # @knapsack-pro/jest
2
2
 
3
- [![CircleCI](https://circleci.com/gh/KnapsackPro/knapsack-pro-jest.svg?style=svg)](https://circleci.com/gh/KnapsackPro/knapsack-pro-jest)
3
+ <p align="center">
4
+ <a href="https://knapsackpro.com?utm_source=github&utm_medium=readme&utm_campaign=knapsack-pro-jest&utm_content=hero_logo">
5
+ <img alt="Knapsack Pro" src="./.github/assets/knapsack.png" width="300" height="300" style="max-width: 100%;" />
6
+ </a>
7
+ </p>
4
8
 
5
- `@knapsack-pro/jest` runs your tests with [Jest](https://jestjs.io) test runner and does dynamic tests allocation across parallel CI nodes using [KnapsackPro.com](https://knapsackpro.com?utm_source=github&utm_medium=readme&utm_campaign=%40knapsack-pro%2Fjest&utm_content=sign_up) Queue Mode to provide the fastest CI build time (optimal test suite timing).
9
+ <h3 align="center">Speed up your tests</h3>
10
+ <p align="center">Run your 1-hour test suite in 2 minutes with optimal parallelisation on your existing CI infrastructure</p>
6
11
 
7
- Learn about Knapsack Pro Queue Mode in the video [how to run tests with dynamic test suite split](https://youtu.be/hUEB1XDKEFY) and learn what CI problems can be solved thanks to it.
12
+ ---
8
13
 
9
- <!-- START doctoc generated TOC please keep comment here to allow auto update -->
10
- <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
14
+ <div align="center">
15
+ <a href="https://circleci.com/gh/KnapsackPro/knapsack-pro-jest">
16
+ <img alt="Circle CI" src="https://circleci.com/gh/KnapsackPro/knapsack-pro-jest.svg?style=svg" />
17
+ </a>
18
+ </div>
11
19
 
12
- ## Table of Contents
20
+ <br />
21
+ <br />
13
22
 
14
- - [Installation](#installation)
15
- - [FAQ](#faq)
16
- - [Development](#development)
17
- - [Requirements](#requirements)
18
- - [Dependencies](#dependencies)
19
- - [Setup](#setup)
20
- - [Publishing](#publishing)
21
- - [Testing](#testing)
22
- - [CI](#ci)
23
- - [Example Jest test suite](#example-jest-test-suite)
23
+ Knapsack Pro wraps [Jest](https://jestjs.io) and works with your existing CI infrastructure to parallelize tests optimally:
24
24
 
25
- <!-- END doctoc generated TOC please keep comment here to allow auto update -->
25
+ - Dynamically splits your tests based on up-to-date test execution data
26
+ - Is designed from the ground up for CI and supports all of them
27
+ - Tracks your CI builds to detect bottlenecks
28
+ - Does not have access to your source code and collects minimal test data
29
+ - Enables you to export historical metrics about your CI builds
30
+ - Replaces local dependencies like Redis with an API and runs your tests regardless of network problems
26
31
 
27
32
  ## Installation
28
33
 
29
34
  See the [docs](https://docs.knapsackpro.com/jest/guide/) to get started.
30
35
 
31
- ## FAQ
32
-
33
- - [FAQ for Knapsack Pro Jest can be found here](https://knapsackpro.com/faq/knapsack_pro_client/knapsack_pro_jest).
34
-
35
- - This project depends on `@knapsack-pro/core`. Please check the [FAQ for `@knapsack-pro/core`](https://github.com/KnapsackPro/knapsack-pro-core-js#table-of-contents) to learn more about core features available to you.
36
-
37
- ## Development
36
+ ## Contributing
38
37
 
39
38
  ### Requirements
40
39
 
41
- You can use [NVM](https://github.com/nvm-sh/nvm) to manage Node version in development.
40
+ ```
41
+ >= Node 18.13.0 LTS
42
+ ```
42
43
 
43
- - `>= Node 18.13.0 LTS`
44
+ You can use [NVM](https://github.com/nvm-sh/nvm) to manage Node versions in development.
44
45
 
45
46
  ### Dependencies
46
47
 
@@ -48,35 +49,35 @@ You can use [NVM](https://github.com/nvm-sh/nvm) to manage Node version in devel
48
49
 
49
50
  ### Setup
50
51
 
51
- 1. Setup [@knapsack-pro/core](https://github.com/KnapsackPro/knapsack-pro-core-js) project.
52
+ 1. Setup the [@knapsack-pro/core](https://github.com/KnapsackPro/knapsack-pro-core-js) project.
52
53
 
53
- **Follow below steps or use `bin/setup_development` script to take care of steps 2-5.**
54
+ **Follow the steps below or use the `bin/setup_development` script to take care of steps 2-5.**
54
55
 
55
- 2. Install dependencies:
56
+ 1. Install the dependencies:
56
57
 
57
- ```
58
- $ npm install
58
+ ```bash
59
+ npm install
59
60
  ```
60
61
 
61
- 3. In order to use local version of `@knapsack-pro/core` run:
62
+ 1. In order to use the local version of `@knapsack-pro/core` run:
62
63
 
63
- ```
64
- $ npm link @knapsack-pro/core
64
+ ```bash
65
+ npm link @knapsack-pro/core
65
66
  ```
66
67
 
67
- 4. Compile TypeScript code to `lib` directory by running:
68
+ 1. Compile the TypeScript code to the `lib` directory by running:
68
69
 
69
- ```
70
- $ npm start
70
+ ```bash
71
+ npm start
71
72
  ```
72
73
 
73
- 5. Register `@knapsack-pro/jest` package globally in your local system. This way we will be able to develop other npm packages dependent on it:
74
+ 1. Register the `@knapsack-pro/jest` package globally in your local system. This way we will be able to develop other npm packages dependent on it:
74
75
 
75
- ```
76
- $ npm link
76
+ ```bash
77
+ npm link
77
78
  ```
78
79
 
79
- 6. Set up your IDE:
80
+ 1. Set up your IDE:
80
81
 
81
82
  - Visual Studio Code
82
83
 
@@ -90,21 +91,34 @@ You can use [NVM](https://github.com/nvm-sh/nvm) to manage Node version in devel
90
91
 
91
92
  Turn on `Format On Save` checkbox.
92
93
 
93
- From now on, every change in code base will be automatically formatted by [Prettier](https://prettier.io/). [ESLint](https://eslint.org/) shows errors and warnings in VSCode.
94
+ From now on, every change in the codebase will be automatically formatted by [Prettier](https://prettier.io/). [ESLint](https://eslint.org/) shows errors and warnings in VSCode.
95
+
96
+ 1. Write some code.
97
+
98
+ ### Testing
99
+
100
+ #### CI
101
+
102
+ If your feature requires code changes in [@knapsack-pro/core](https://github.com/KnapsackPro/knapsack-pro-core-js), please push the `@knapsack-pro/core` to GitHub first. Then you can push changes for `@knapsack-pro/jest` to ensure the CI will use the latest `@knapsack-pro/core`.
103
+
104
+ #### Example Jest test suite
105
+
106
+ To test `@knapsack-pro/jest` against a real test suite we use:
94
107
 
95
- 7. Write some code.
108
+ - [jest-example-test-suite](https://github.com/KnapsackPro/jest-example-test-suite)
109
+ - (deprecated) [react](https://github.com/KnapsackPro/react)
96
110
 
97
111
  ### Publishing
98
112
 
99
- 1. Sign in to npm registry with command:
113
+ 1. Sign in to the npm registry with:
100
114
 
101
- ```
102
- $ npm adduser
115
+ ```bash
116
+ npm adduser
103
117
  ```
104
118
 
105
- 2. Ensure you have the latest version of `@knapsack-pro/core` in `package.json`:
119
+ 1. Ensure you have the latest version of `@knapsack-pro/core` in `package.json`:
106
120
 
107
- ```
121
+ ```bash
108
122
  {
109
123
  "dependencies": {
110
124
  "@knapsack-pro/core": "^x.x.x"
@@ -112,83 +126,64 @@ You can use [NVM](https://github.com/nvm-sh/nvm) to manage Node version in devel
112
126
  }
113
127
  ```
114
128
 
115
- Then run `npm install`. This way you will be able to test `@knapsack-pro/core` installed from npm registry instead of local one that was linked with `npm link @knapsack-pro/core`.
129
+ Run `npm install`. This way you will be able to test `@knapsack-pro/core` installed from npm registry instead of the local one that was linked with `npm link @knapsack-pro/core`.
116
130
 
117
- Now commit updated `package.json` and `package-lock.json`.
131
+ Commit the updated `package.json` and `package-lock.json`:
118
132
 
119
- ```
120
- $ git commit -am "Update @knapsack-pro/core"
133
+ ```bash
134
+ git commit -am "Update @knapsack-pro/core"
121
135
  ```
122
136
 
123
- 3. Before releasing a new version of package please update `CHANGELOG.md` with [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator):
137
+ 1. Before releasing a new version of the package, please update `CHANGELOG.md` with [`github_changelog_generator`](https://github.com/github-changelog-generator/github-changelog-generator):
124
138
 
125
- ```
126
- $ gem install github_changelog_generator
139
+ ```bash
140
+ gem install github_changelog_generator
127
141
 
128
142
  # generate CHANGELOG.md
129
- $ github_changelog_generator --user KnapsackPro --project knapsack-pro-jest
130
- $ git commit -am "Update CHANGELOG.md"
131
- $ git push origin master
143
+ github_changelog_generator --user KnapsackPro --project knapsack-pro-jest
144
+ git commit -am "Update CHANGELOG.md"
145
+ git push origin master
132
146
  ```
133
147
 
134
- 4. If you have added new files to the repository and they should be part of the released npm package then please ensure they are included in `files` array in `package.json`.
135
-
136
- 5. If you have changed any headers in `README.md` please refresh table of contents with:
137
-
138
- ```
139
- $ npm run doctoc
140
- ```
148
+ 1. If you have added new files to the repository, and they should be part of the released npm package, please ensure they are included in the `files` array in `package.json`.
141
149
 
142
- 6. Compile project:
150
+ 1. Compile the project:
143
151
 
144
- ```
145
- # ensure you use local version of @knapsack-pro/core
146
- $ npm link @knapsack-pro/core
152
+ ```bash
153
+ # Ensure you use local version of @knapsack-pro/core
154
+ npm link @knapsack-pro/core
147
155
 
148
- $ npm run build
156
+ npm run build
149
157
  ```
150
158
 
151
- 7. In order to [bump version of the package](https://docs.npmjs.com/cli/version) run below command. It will also create a version commit and tag for the release:
159
+ 1. In order to [bump the version of the package](https://docs.npmjs.com/cli/version) run the command below. It will also create a version commit and tag for the release:
152
160
 
153
- ```
154
- # bump patch version 0.0.x
155
- $ npm version patch
161
+ ```bash
162
+ # Bump patch version 0.0.x
163
+ npm version patch
156
164
 
157
- # bump minor version 0.x.0
158
- $ npm version minor
165
+ # Bump minor version 0.x.0
166
+ npm version minor
159
167
  ```
160
168
 
161
- 8. Push to git repository created commit and tag:
169
+ 1. Push the commit and tag:
162
170
 
163
- ```
164
- $ git push origin master --tags
171
+ ```bash
172
+ git push origin master --tags
165
173
  ```
166
174
 
167
- 9. Now when git tag is on Github you can update `CHANGELOG.md` again.
175
+ 1. When the git tag is on Github, you can update `CHANGELOG.md`:
168
176
 
177
+ ```bash
178
+ github_changelog_generator --user KnapsackPro --project knapsack-pro-jest
179
+ git commit -am "Update CHANGELOG.md"
180
+ git push origin master
169
181
  ```
170
- $ github_changelog_generator --user KnapsackPro --project knapsack-pro-jest
171
- $ git commit -am "Update CHANGELOG.md"
172
- $ git push origin master
173
- ```
174
-
175
- 10. Now you can publish package to npm registry:
176
182
 
177
- ```
178
- $ npm publish
179
- ```
183
+ 1. Publish the package to the npm registry:
180
184
 
181
- 11. Update the latest available library version in `TestSuiteClientVersionChecker` for the Knapsack Pro API repository.
182
-
183
- ### Testing
184
-
185
- #### CI
186
-
187
- If your feature requires code change in [@knapsack-pro/core](https://github.com/KnapsackPro/knapsack-pro-core-js) then please push the `@knapsack-pro/core` to GitHub first. Then you can push changes for `@knapsack-pro/jest` to ensure the CI will use the latest `@knapsack-pro/core`.
188
-
189
- #### Example Jest test suite
190
-
191
- To test `@knapsack-pro/jest` against real test suite we use:
185
+ ```bash
186
+ npm publish
187
+ ```
192
188
 
193
- - [jest-example-test-suite](https://github.com/KnapsackPro/jest-example-test-suite) project.
194
- - (deprecated) [react](https://github.com/KnapsackPro/react)
189
+ 1. Update the latest available library version in `TestSuiteClientVersionChecker` for the Knapsack Pro API repository.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knapsack-pro/jest",
3
- "version": "5.4.1",
3
+ "version": "5.6.0",
4
4
  "description": "Knapsack Pro Jest splits Jest tests across CI nodes and makes sure that tests will run in optimal time on each CI node.",
5
5
  "keywords": [
6
6
  "knapsack",
@@ -35,8 +35,7 @@
35
35
  "eslint:check": "eslint . --ext .ts",
36
36
  "eslint:format": "eslint . --ext .ts --fix",
37
37
  "prettier:check": "prettier --check .",
38
- "prettier:format": "prettier --config .prettierrc.json 'src/**/*.ts' --write",
39
- "doctoc": "doctoc --title \"## Table of Contents\" README.md"
38
+ "prettier:format": "prettier --config .prettierrc.json 'src/**/*.ts' --write"
40
39
  },
41
40
  "files": [
42
41
  "/lib"
@@ -60,31 +59,30 @@
60
59
  "uuid": "^8.3.2"
61
60
  },
62
61
  "peerDependencies": {
63
- "jest": ">=22.0.0 <29.0.0"
62
+ "jest": ">=22.0.0"
64
63
  },
65
64
  "devDependencies": {
66
65
  "@babel/core": "^7.18.2",
67
66
  "@babel/preset-env": "^7.18.2",
68
67
  "@babel/register": "^7.17.7",
69
- "@types/jest": "^28.1.1",
70
68
  "@types/glob": "^7.2.0",
69
+ "@types/jest": "^28.1.1",
71
70
  "@types/node": "^17.0.41",
72
71
  "@typescript-eslint/eslint-plugin": "^5.27.1",
73
72
  "@typescript-eslint/parser": "^5.27.1",
74
73
  "del": "^6.1.1",
75
- "doctoc": "^2.2.0",
76
74
  "eslint": "^7.32.0",
77
75
  "eslint-config-airbnb-base": "^15.0.0",
78
76
  "eslint-config-prettier": "^8.5.0",
79
77
  "eslint-plugin-import": "^2.26.0",
80
78
  "eslint-plugin-prettier": "^4.0.0",
81
79
  "gulp": "^4.0.2",
82
- "gulp-typescript": "^5.0.1",
83
80
  "gulp-chmod": "^3.0.0",
84
81
  "gulp-filter": "^7.0.0",
85
- "jest": "^28.1.0",
82
+ "gulp-typescript": "^5.0.1",
83
+ "jest": "^29.4.3",
86
84
  "prettier": "^2.6.2",
87
- "ts-jest": "^28.0.4",
85
+ "ts-jest": "^29.0.5",
88
86
  "typescript": "^4.7.3"
89
87
  }
90
88
  }