Skip to content

Commit 483ac04

Browse files
committed
fix(TU-2535): bump jest, fix tests
1 parent cc686b5 commit 483ac04

File tree

4 files changed

+1052
-1273
lines changed

4 files changed

+1052
-1273
lines changed

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"eslint": "^8.43.0",
6969
"husky": "^4.0.0-beta.1",
7070
"in-publish": "^2.0.0",
71-
"jest": "^24.9.0",
71+
"jest": "^28.1.0",
7272
"json-server": "^0.15.1",
7373
"lint-staged": "^13.2.2",
7474
"nodemon": "^1.19.2",
@@ -83,13 +83,15 @@
8383
"rollup-plugin-terser": "^5.1.1",
8484
"rollup-plugin-typescript2": "^0.24.1",
8585
"semantic-release": "^17.0.7",
86-
"ts-jest": "^24.0.2",
86+
"ts-jest": "^28.0.8",
8787
"tslib": "^2.6.2",
8888
"typescript": "^4.9.5"
8989
},
9090
"jest": {
9191
"automock": false,
92-
"testURL": "http://localhost/",
92+
"testEnvironmentOptions": {
93+
"url": "http://localhost/"
94+
},
9395
"preset": "ts-jest"
9496
},
9597
"prettier": "@typeform/eslint-config/prettier",

tests/common.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
export const axios = new (require('axios-mock-adapter'))(require('axios'))
1+
import axiosLib from 'axios'
2+
import MockAdapter from 'axios-mock-adapter'
3+
4+
export const axios = new MockAdapter(axiosLib)

tests/unit/create-client.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test('request pass correct headers', async () => {
2121
},
2222
})
2323
expect(axios.history.get[0].url).toBe(`${API_BASE_URL}/forms`)
24-
expect(axios.history.get[0].headers).toEqual({
24+
expect({ ...axios.history.get[0].headers }).toEqual({
2525
Accept: 'application/json, text/plain, */*',
2626
Accepts: 'application/json',
2727
Authorization: 'bearer abc',

0 commit comments

Comments
 (0)