From dfd7a63804c15ee84d66cfd8fe5c5b24d0e06f31 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Mon, 4 Nov 2024 09:26:18 +0200 Subject: [PATCH 1/7] chore: upgrade TSTyche --- package.json | 2 +- packages/jest-expect/__typetests__/jest-expect.test.ts | 4 ++-- .../jest-mock/__typetests__/mock-functions.test.ts | 4 ++-- yarn.lock | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 7474cd3ff180..8cf0ab6b8bbd 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "strip-json-comments": "^3.1.1", "tempy": "^1.0.0", "ts-node": "^10.5.0", - "tstyche": "^2.0.0", + "tstyche": "^3.0.0-rc.2", "typescript": "^5.0.4", "webpack": "^5.68.0", "webpack-node-externals": "^3.0.0", diff --git a/packages/jest-expect/__typetests__/jest-expect.test.ts b/packages/jest-expect/__typetests__/jest-expect.test.ts index 966ac9e9fdd9..822c368cd1f9 100644 --- a/packages/jest-expect/__typetests__/jest-expect.test.ts +++ b/packages/jest-expect/__typetests__/jest-expect.test.ts @@ -29,9 +29,9 @@ describe('JestExpect', () => { }); test('is superset of `Expect`', () => { - expect().type.toMatch(); + expect().type.toBeAssignableTo(); - expect().type.not.toMatch(); + expect().type.not.toBeAssignableTo(); }); test('allows type inference of the `actual` argument', () => { diff --git a/packages/jest-mock/__typetests__/mock-functions.test.ts b/packages/jest-mock/__typetests__/mock-functions.test.ts index d73d77f28326..fff6feedcec1 100644 --- a/packages/jest-mock/__typetests__/mock-functions.test.ts +++ b/packages/jest-mock/__typetests__/mock-functions.test.ts @@ -87,7 +87,7 @@ describe('jest.fn()', () => { test('models typings of mocked function', () => { // eslint-disable-next-line @typescript-eslint/ban-types - expect(fn()).type.toMatch(); + expect(fn()).type.toBeAssignableTo(); expect(fn()).type.toBe) => unknown>>(); expect(fn(() => {})).type.toBe void>>(); @@ -424,7 +424,7 @@ describe('jest.spyOn()', () => { test('models typings of spied object', () => { // eslint-disable-next-line @typescript-eslint/ban-types - expect(spy).type.not.toMatch(); + expect(spy).type.not.toBeAssignableTo(); expect(spy()).type.toRaiseError(); expect(new spy()).type.toRaiseError(); diff --git a/yarn.lock b/yarn.lock index 42d29264aa94..62bb1e9eef64 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3322,7 +3322,7 @@ __metadata: strip-json-comments: ^3.1.1 tempy: ^1.0.0 ts-node: ^10.5.0 - tstyche: ^2.0.0 + tstyche: ^3.0.0-rc.2 typescript: ^5.0.4 webpack: ^5.68.0 webpack-node-externals: ^3.0.0 @@ -20584,9 +20584,9 @@ __metadata: languageName: node linkType: hard -"tstyche@npm:^2.0.0": - version: 2.1.1 - resolution: "tstyche@npm:2.1.1" +"tstyche@npm:^3.0.0-rc.2": + version: 3.0.0-rc.2 + resolution: "tstyche@npm:3.0.0-rc.2" peerDependencies: typescript: 4.x || 5.x peerDependenciesMeta: @@ -20594,7 +20594,7 @@ __metadata: optional: true bin: tstyche: ./build/bin.js - checksum: abbd751b6666faad2b646dfdf2c3a95ea9b948b6803fa1e1df3dc2290737437268d25cc0064c5d5e418a55cba7cbf5d346f072870491d831b9472a0da7201865 + checksum: 8a0db3b131c4e19d012a3946741660b9109447997b03bb63911ae04c3cf8e573c5caeae67f34e7e992754ea373f4d0859afdad7d197636508486c0e9cf13503d languageName: node linkType: hard From fc0442910ce47859ead8e86d87d97b64237f9e37 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Mon, 4 Nov 2024 09:32:33 +0200 Subject: [PATCH 2/7] clean up --- packages/jest-expect/__typetests__/jest-expect.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jest-expect/__typetests__/jest-expect.test.ts b/packages/jest-expect/__typetests__/jest-expect.test.ts index 822c368cd1f9..8360e0375c78 100644 --- a/packages/jest-expect/__typetests__/jest-expect.test.ts +++ b/packages/jest-expect/__typetests__/jest-expect.test.ts @@ -29,9 +29,9 @@ describe('JestExpect', () => { }); test('is superset of `Expect`', () => { - expect().type.toBeAssignableTo(); + expect(jestExpect).type.toBeAssignableTo(_expect); - expect().type.not.toBeAssignableTo(); + expect(_expect).type.not.toBeAssignableTo(jestExpect); }); test('allows type inference of the `actual` argument', () => { From b9b84f64945b5f5f78446c4a46cd65358584eec6 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Mon, 4 Nov 2024 09:59:02 +0200 Subject: [PATCH 3/7] add `$schema` --- tstyche.config.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tstyche.config.json b/tstyche.config.json index 917ca2617ca0..1ad61e14ae49 100644 --- a/tstyche.config.json +++ b/tstyche.config.json @@ -1,3 +1,4 @@ { + "$schema": "https://tstyche.org/schemas/config.json", "testFileMatch": ["packages/*/__typetests__/*.test.ts"] } From f959c84b520e1692064e6cdf31b0ba9d865b7b58 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Tue, 5 Nov 2024 21:47:49 +0200 Subject: [PATCH 4/7] stable release --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 8cf0ab6b8bbd..4c7abdf94cd2 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "strip-json-comments": "^3.1.1", "tempy": "^1.0.0", "ts-node": "^10.5.0", - "tstyche": "^3.0.0-rc.2", + "tstyche": "^3.0.0", "typescript": "^5.0.4", "webpack": "^5.68.0", "webpack-node-externals": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index 62bb1e9eef64..9260b48bd059 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3322,7 +3322,7 @@ __metadata: strip-json-comments: ^3.1.1 tempy: ^1.0.0 ts-node: ^10.5.0 - tstyche: ^3.0.0-rc.2 + tstyche: ^3.0.0 typescript: ^5.0.4 webpack: ^5.68.0 webpack-node-externals: ^3.0.0 @@ -20584,9 +20584,9 @@ __metadata: languageName: node linkType: hard -"tstyche@npm:^3.0.0-rc.2": - version: 3.0.0-rc.2 - resolution: "tstyche@npm:3.0.0-rc.2" +"tstyche@npm:^3.0.0": + version: 3.0.0 + resolution: "tstyche@npm:3.0.0" peerDependencies: typescript: 4.x || 5.x peerDependenciesMeta: @@ -20594,7 +20594,7 @@ __metadata: optional: true bin: tstyche: ./build/bin.js - checksum: 8a0db3b131c4e19d012a3946741660b9109447997b03bb63911ae04c3cf8e573c5caeae67f34e7e992754ea373f4d0859afdad7d197636508486c0e9cf13503d + checksum: 6401fd5e45e5fd1d21a1f9934a0d2d7957a85c2f970086bc18b577a9d87909d89ad24aa239e12138019b7ff7ea56aee9aaf9ed6a9beeae5ee4cf35055ae0cf7b languageName: node linkType: hard From 1ec00009a68fc2b3bb00f620f7b4abdc5fe7d726 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Mon, 23 Dec 2024 16:41:56 +0200 Subject: [PATCH 5/7] fix match pattern --- tstyche.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tstyche.config.json b/tstyche.config.json index 1ad61e14ae49..bba3950eddc0 100644 --- a/tstyche.config.json +++ b/tstyche.config.json @@ -1,4 +1,4 @@ { "$schema": "https://tstyche.org/schemas/config.json", - "testFileMatch": ["packages/*/__typetests__/*.test.ts"] + "testFileMatch": ["packages/*/__typetests__/**/*.test.ts"] } From f7048267a1582536f2c37559b0c40801caaaf73e Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Mon, 23 Dec 2024 21:48:44 +0200 Subject: [PATCH 6/7] update lock file --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 286acd0ec2c3..57b08028107e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3334,7 +3334,7 @@ __metadata: strip-json-comments: ^3.1.1 tempy: ^1.0.0 ts-node: ^10.5.0 - tstyche: ^3.0.0 + tstyche: ^3.2.0 typescript: ^5.0.4 webpack: ^5.68.0 webpack-node-externals: ^3.0.0 @@ -20584,9 +20584,9 @@ __metadata: languageName: node linkType: hard -"tstyche@npm:^3.0.0": - version: 3.0.0 - resolution: "tstyche@npm:3.0.0" +"tstyche@npm:^3.2.0": + version: 3.2.0 + resolution: "tstyche@npm:3.2.0" peerDependencies: typescript: 4.x || 5.x peerDependenciesMeta: @@ -20594,7 +20594,7 @@ __metadata: optional: true bin: tstyche: ./build/bin.js - checksum: 6401fd5e45e5fd1d21a1f9934a0d2d7957a85c2f970086bc18b577a9d87909d89ad24aa239e12138019b7ff7ea56aee9aaf9ed6a9beeae5ee4cf35055ae0cf7b + checksum: 91be7f7136a722e254617ed98e4a6e2daa5170f41da5d7857d35816d4564a633f6e060e27e50599a4de32fdb3d404dae077a2aae72629089a54c68835e6542c9 languageName: node linkType: hard From f4123aeb2673b42436affbbbdc683bd70d3c48ca Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Mon, 23 Dec 2024 21:50:51 +0200 Subject: [PATCH 7/7] fix lock file --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index 57b08028107e..259391c0d3e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3334,7 +3334,7 @@ __metadata: strip-json-comments: ^3.1.1 tempy: ^1.0.0 ts-node: ^10.5.0 - tstyche: ^3.2.0 + tstyche: ^3.0.0 typescript: ^5.0.4 webpack: ^5.68.0 webpack-node-externals: ^3.0.0 @@ -20584,7 +20584,7 @@ __metadata: languageName: node linkType: hard -"tstyche@npm:^3.2.0": +"tstyche@npm:^3.0.0": version: 3.2.0 resolution: "tstyche@npm:3.2.0" peerDependencies: