Skip to content

Commit f5318f6

Browse files
committed
chore(package): upgrade to jest v30
1 parent 1f0fd95 commit f5318f6

File tree

6 files changed

+1197
-677
lines changed

6 files changed

+1197
-677
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"get-port": "5.1.1",
7676
"globals": "16.1.0",
7777
"husky": "9.1.7",
78-
"jest": "29.7.0",
78+
"jest": "30.0.0",
7979
"lint-staged": "16.0.0",
8080
"mockttp": "3.17.1",
8181
"open": "8.4.2",

test/e2e/http-proxy-middleware.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('E2E http-proxy-middleware', () => {
3636
});
3737

3838
it('should not proxy requests when request url does not match pathFilter', () => {
39-
expect(mockNext).toBeCalled();
39+
expect(mockNext).toHaveBeenCalled();
4040
});
4141
});
4242
});

test/unit/configuration.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('configFactory', () => {
1212
});
1313

1414
it('should throw an error when target and router option are missing', () => {
15-
expect(fn).toThrowError(Error);
15+
expect(fn).toThrow(Error);
1616
});
1717
});
1818

@@ -29,7 +29,7 @@ describe('configFactory', () => {
2929
});
3030

3131
it('should not throw an error when target option is missing when router is used', () => {
32-
expect(fn).not.toThrowError(Error);
32+
expect(fn).not.toThrow(Error);
3333
});
3434
});
3535
});

test/unit/path-filter.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,40 +214,40 @@ describe('Path Filter', () => {
214214

215215
describe('Throw error', () => {
216216
it('should throw error with null', () => {
217-
expect(testPathFilter(null)).toThrowError(Error);
217+
expect(testPathFilter(null)).toThrow(Error);
218218
});
219219

220220
it('should throw error with object literal', () => {
221-
expect(testPathFilter(fakeReq)).toThrowError(Error);
221+
expect(testPathFilter(fakeReq)).toThrow(Error);
222222
});
223223

224224
it('should throw error with integers', () => {
225-
expect(testPathFilter(123)).toThrowError(Error);
225+
expect(testPathFilter(123)).toThrow(Error);
226226
});
227227

228228
it('should throw error with mixed string and glob pattern', () => {
229-
expect(testPathFilter(['/api', '!*.html'])).toThrowError(Error);
229+
expect(testPathFilter(['/api', '!*.html'])).toThrow(Error);
230230
});
231231
});
232232

233233
describe('Do not throw error', () => {
234234
it('should not throw error with string', () => {
235-
expect(testPathFilter('/123')).not.toThrowError(Error);
235+
expect(testPathFilter('/123')).not.toThrow(Error);
236236
});
237237

238238
it('should not throw error with Array', () => {
239-
expect(testPathFilter(['/123'])).not.toThrowError(Error);
239+
expect(testPathFilter(['/123'])).not.toThrow(Error);
240240
});
241241
it('should not throw error with glob', () => {
242-
expect(testPathFilter('/**')).not.toThrowError(Error);
242+
expect(testPathFilter('/**')).not.toThrow(Error);
243243
});
244244

245245
it('should not throw error with Array of globs', () => {
246-
expect(testPathFilter(['/**', '!*.html'])).not.toThrowError(Error);
246+
expect(testPathFilter(['/**', '!*.html'])).not.toThrow(Error);
247247
});
248248

249249
it('should not throw error with Function', () => {
250-
expect(testPathFilter(() => {})).not.toThrowError(Error);
250+
expect(testPathFilter(() => {})).not.toThrow(Error);
251251
});
252252
});
253253
});

test/unit/path-rewriter.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,22 +160,22 @@ describe('Path rewriting', () => {
160160
});
161161

162162
it('should throw when bad config is provided', () => {
163-
expect(badFn(123)).toThrowError(Error);
164-
expect(badFn('abc')).toThrowError(Error);
165-
expect(badFn([])).toThrowError(Error);
166-
expect(badFn([1, 2, 3])).toThrowError(Error);
163+
expect(badFn(123)).toThrow(Error);
164+
expect(badFn('abc')).toThrow(Error);
165+
expect(badFn([])).toThrow(Error);
166+
expect(badFn([1, 2, 3])).toThrow(Error);
167167
});
168168

169169
it('should not throw when empty Object config is provided', () => {
170-
expect(badFn({})).not.toThrowError(Error);
170+
expect(badFn({})).not.toThrow(Error);
171171
});
172172

173173
it('should not throw when function config is provided', () => {
174-
expect(badFn(() => {})).not.toThrowError(Error);
174+
expect(badFn(() => {})).not.toThrow(Error);
175175
});
176176

177177
it('should not throw when async function config is provided', () => {
178-
expect(badFn(async () => {})).not.toThrowError(Error);
178+
expect(badFn(async () => {})).not.toThrow(Error);
179179
});
180180
});
181181
});

0 commit comments

Comments
 (0)