Skip to content

Commit e38c0e9

Browse files
authored
chore(release): 29.0.1 (#3810)
1 parent 2788ba5 commit e38c0e9

20 files changed

+603
-189
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## [29.0.1](https://github.com/kulshekhar/ts-jest/compare/v29.0.0...v29.0.1) (2022-09-13)
2+
3+
4+
### Bug Fixes
5+
6+
* **legacy:** include existing globals config in cached config ([#3803](https://github.com/kulshekhar/ts-jest/issues/3803)) ([e79be47](https://github.com/kulshekhar/ts-jest/commit/e79be47d2b81a677d0dd39d84328a38ca0f0ffc6))
7+
8+
9+
### Features
10+
11+
* add typings for `ts-jest` options via `transform` config ([#3805](https://github.com/kulshekhar/ts-jest/issues/3805)) ([664b0f2](https://github.com/kulshekhar/ts-jest/commit/664b0f2b446a36dd7661f4840ca3dd7722f1f6ff))
12+
13+
14+
115
# [29.0.0](https://github.com/kulshekhar/ts-jest/compare/v29.0.0-next.1...v29.0.0) (2022-09-08)
216

317

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ts-jest",
3-
"version": "29.0.0",
3+
"version": "29.0.1",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"bin": {

website/versioned_docs/version-29.0/debugging.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,10 @@ export TS_JEST_LOG=ts-jest.log
1717

1818
**Windows**
1919

20-
Command Prompt (cmd)
21-
22-
```
20+
```Command Prompt tab
2321
set TS_JEST_LOG=ts-jest.log
2422
```
2523

26-
PowerShell
27-
28-
```
24+
```PowerShell tab
2925
$env:TS_JEST_LOG = 'ts-jest.log'
3026
```

website/versioned_docs/version-29.0/getting-started/installation.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,10 @@ title: Installation
77

88
You can install `ts-jest` and dependencies all at once with one of the following commands.
99

10-
#### NPM
11-
12-
```sh
10+
```bash npm2yarn
1311
npm install --save-dev jest typescript ts-jest @types/jest
1412
```
1513

16-
#### Yarn
17-
18-
```sh
19-
yarn add --dev jest typescript ts-jest @types/jest
20-
```
21-
2214
:::tip
2315

2416
Tip: If you get an error with the following `npm` commands such as `npx: command not found`, you can replace `npx XXX` with `node node_modules/.bin/XXX` from the root of your project.
@@ -34,15 +26,11 @@ To make it transpile TypeScript with `ts-jest`, we will need to create a configu
3426

3527
`ts-jest` can create the configuration file for you automatically:
3628

37-
#### NPM
38-
39-
```sh
29+
```npm tab
4030
npx ts-jest config:init
4131
```
4232

43-
#### Yarn
44-
45-
```sh
33+
```Yarn tab
4634
yarn ts-jest config:init
4735
```
4836

website/versioned_docs/version-29.0/getting-started/options.md

Lines changed: 19 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,8 @@ title: Options
88
All `ts-jest` specific options can be defined in Jest `transform` config object in the `package.json` file of your project,
99
or through a `jest.config.js`, or `jest.config.ts` file.
1010

11-
```json
12-
// package.json
13-
{
14-
// [...]
15-
"jest": {
16-
"transform": {
17-
"<regex_match_files>": [
18-
"ts-jest",
19-
{
20-
// ts-jest configuration goes here
21-
}
22-
]
23-
}
24-
}
25-
}
26-
```
27-
28-
Or through JavaScript:
29-
30-
```js
31-
// jest.config.js
11+
```js tab
12+
/** @type {import('ts-jest').JestConfigWithTsJest} */
3213
module.exports = {
3314
// [...]
3415
transform: {
@@ -42,44 +23,36 @@ module.exports = {
4223
}
4324
```
4425

45-
:::tip
26+
```ts tab
27+
import type { JestConfigWithTsJest } from './types'
4628

47-
To utilize IDE suggestions, you can use `JSDoc` comments to provide suggested `ts-jest` configs for your Jest config:
48-
49-
```js
50-
/** @type {import('ts-jest').InitialOptionsTsJest} */
51-
module.exports = config = {
29+
const jestConfig: JestConfigWithTsJest = {
5230
// [...]
5331
transform: {
5432
'<regex_match_files>': [
5533
'ts-jest',
5634
{
57-
// ts-jest configuration goes here and your IDE will suggest which configs when typing
35+
// ts-jest configuration goes here
5836
},
5937
],
6038
},
6139
}
6240
```
6341

64-
:::
65-
66-
Or through TypeScript (if `ts-node` is installed):
67-
68-
```ts
69-
// jest.config.ts
70-
import type { InitialOptionsTsJest } from 'ts-jest'
71-
72-
const config: InitialOptionsTsJest = {
73-
transform: {
74-
'<regex_match_files>': [
75-
'ts-jest',
76-
{
77-
// ts-jest configuration goes here
78-
},
79-
],
80-
},
42+
```JSON tab
43+
{
44+
// [...]
45+
"jest": {
46+
"transform": {
47+
"<regex_match_files>": [
48+
"ts-jest",
49+
{
50+
// ts-jest configuration goes here
51+
}
52+
]
53+
}
54+
}
8155
}
82-
export default config
8356
```
8457

8558
:::important

website/versioned_docs/version-29.0/getting-started/options/astTransformers.md

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ The option is `astTransformers` and it allows ones to specify which 3 types of T
1616

1717
#### Basic Transformers
1818

19-
```js
20-
// jest.config.js
19+
```js tab
20+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2121
module.exports = {
2222
// [...]
2323
transform: {
@@ -33,8 +33,27 @@ module.exports = {
3333
}
3434
```
3535

36-
```json
37-
// OR package.json
36+
```ts tab
37+
import type { JestConfigWithTsJest } from './types'
38+
39+
const jestConfig: JestConfigWithTsJest = {
40+
// [...]
41+
transform: {
42+
'<regex_match_files>': [
43+
'ts-jest',
44+
{
45+
astTransformers: {
46+
before: ['my-custom-transformer'],
47+
},
48+
},
49+
],
50+
},
51+
}
52+
53+
export default jestConfig
54+
```
55+
56+
```JSON tab
3857
{
3958
// [...]
4059
"jest": {
@@ -54,8 +73,8 @@ module.exports = {
5473

5574
#### Configuring transformers with options
5675

57-
```js
58-
// jest.config.js
76+
```js tab
77+
/** @type {import('ts-jest').JestConfigWithTsJest} */
5978
module.exports = {
6079
// [...]
6180
transform: {
@@ -76,8 +95,32 @@ module.exports = {
7695
}
7796
```
7897

79-
```json
80-
// OR package.json
98+
```ts tab
99+
import type { JestConfigWithTsJest } from './types'
100+
101+
const jestConfig: JestConfigWithTsJest = {
102+
// [...]
103+
transform: {
104+
'<regex_match_files>': [
105+
'ts-jest',
106+
{
107+
astTransformers: {
108+
before: [
109+
{
110+
path: 'my-custom-transformer-that-needs-extra-opts',
111+
options: {}, // extra options to pass to transformers here
112+
},
113+
],
114+
},
115+
},
116+
],
117+
},
118+
}
119+
120+
export default jestConfig
121+
```
122+
123+
```JSON tab
81124
{
82125
// [...]
83126
"jest": {

0 commit comments

Comments
 (0)