Skip to content

Commit 6e6ef32

Browse files
authored
chore: update Jest to v29 (#246)
1 parent 180dfe7 commit 6e6ef32

File tree

5 files changed

+497
-490
lines changed

5 files changed

+497
-490
lines changed

jest.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ module.exports = {
1717
statements: -10,
1818
},
1919
},
20-
globals: {
21-
'ts-jest': {
22-
tsconfig: 'tsconfig.json',
23-
},
20+
transform: {
21+
'\\.[jt]sx?$': ['ts-jest', { tsconfig: 'tsconfig.json' }],
2422
},
2523
};

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@
5050
"@bjerk/eslint-config": "^2.0.1",
5151
"@cobraz/prettier": "^2.0.0",
5252
"@tsconfig/node16": "^1.0.3",
53-
"@types/jest": "^28.1.1",
53+
"@types/jest": "^29.5.0",
5454
"@types/json-schema-faker": "^0.5.1",
5555
"@types/node": "^16",
5656
"husky": "^4.3.0",
57-
"jest": "28.1.1",
57+
"jest": "29.5.0",
5858
"json-schema-faker": "^0.5.0-rcv.32",
5959
"lint-staged": "13.1.0",
6060
"prettier": "^2.6.2",
61-
"ts-jest": "^28.0.4",
61+
"ts-jest": "^29.1.0",
6262
"typedoc": "^0.23.7",
6363
"typedoc-plugin-markdown": "^3.1.1",
6464
"typescript": "^4.3",

src/__tests__/fastify-plugin.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('fastify-plugin', () => {
9494
});
9595

9696
expect(res.payload).toMatchInlineSnapshot(
97-
`"{\\"statusCode\\":500,\\"error\\":\\"Internal Server Error\\",\\"message\\":\\"error\\"}"`,
97+
`"{"statusCode":500,"error":"Internal Server Error","message":"error"}"`,
9898
);
9999
});
100100

@@ -119,7 +119,7 @@ describe('fastify-plugin', () => {
119119
expect(parser).toHaveBeenCalled();
120120

121121
expect(res.payload).toMatchInlineSnapshot(
122-
`"{\\"statusCode\\":500,\\"error\\":\\"Internal Server Error\\",\\"message\\":\\"parsing fail\\"}"`,
122+
`"{"statusCode":500,"error":"Internal Server Error","message":"parsing fail"}"`,
123123
);
124124
});
125125

src/__tests__/index.test.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import * as pkg from '../index';
33
describe('index', () => {
44
it('should export all methods', () => {
55
expect(pkg).toMatchInlineSnapshot(`
6-
Object {
6+
{
77
"PubSubHandlerResponse": [Function],
8-
"PubSubMessage": Object {
9-
"properties": Object {
10-
"attributes": Object {
8+
"PubSubMessage": {
9+
"properties": {
10+
"attributes": {
1111
"additionalProperties": false,
12-
"patternProperties": Object {
13-
"^(.*)$": Object {
12+
"patternProperties": {
13+
"^(.*)$": {
1414
"type": "string",
1515
Symbol(TypeBox.Kind): "String",
1616
},
@@ -19,30 +19,30 @@ describe('index', () => {
1919
Symbol(TypeBox.Modifier): "Optional",
2020
Symbol(TypeBox.Kind): "Record",
2121
},
22-
"data": Object {
22+
"data": {
2323
"type": "string",
2424
Symbol(TypeBox.Kind): "String",
2525
},
26-
"messageId": Object {
26+
"messageId": {
2727
"type": "string",
2828
Symbol(TypeBox.Modifier): "Optional",
2929
Symbol(TypeBox.Kind): "String",
3030
},
3131
},
32-
"required": Array [
32+
"required": [
3333
"data",
3434
],
3535
"type": "object",
3636
Symbol(TypeBox.Kind): "Object",
3737
},
38-
"PubSubRequest": Object {
39-
"properties": Object {
40-
"message": Object {
41-
"properties": Object {
42-
"attributes": Object {
38+
"PubSubRequest": {
39+
"properties": {
40+
"message": {
41+
"properties": {
42+
"attributes": {
4343
"additionalProperties": false,
44-
"patternProperties": Object {
45-
"^(.*)$": Object {
44+
"patternProperties": {
45+
"^(.*)$": {
4646
"type": "string",
4747
Symbol(TypeBox.Kind): "String",
4848
},
@@ -51,28 +51,28 @@ describe('index', () => {
5151
Symbol(TypeBox.Modifier): "Optional",
5252
Symbol(TypeBox.Kind): "Record",
5353
},
54-
"data": Object {
54+
"data": {
5555
"type": "string",
5656
Symbol(TypeBox.Kind): "String",
5757
},
58-
"messageId": Object {
58+
"messageId": {
5959
"type": "string",
6060
Symbol(TypeBox.Modifier): "Optional",
6161
Symbol(TypeBox.Kind): "String",
6262
},
6363
},
64-
"required": Array [
64+
"required": [
6565
"data",
6666
],
6767
"type": "object",
6868
Symbol(TypeBox.Kind): "Object",
6969
},
70-
"subscription": Object {
70+
"subscription": {
7171
"type": "string",
7272
Symbol(TypeBox.Kind): "String",
7373
},
7474
},
75-
"required": Array [
75+
"required": [
7676
"message",
7777
"subscription",
7878
],

0 commit comments

Comments
 (0)