Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(type tests): bump jest-runner-tsd #12299

Merged
merged 5 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@jest/globals": "workspace:*",
"@jest/test-utils": "workspace:*",
"@tsconfig/node10": "^1.0.8",
"@tsd/typescript": "~4.1.5",
mrazauskas marked this conversation as resolved.
Show resolved Hide resolved
"@types/babel__core": "^7.0.0",
"@types/babel__generator": "^7.0.0",
"@types/babel__template": "^7.0.0",
Expand Down Expand Up @@ -55,7 +56,7 @@
"jest-changed-files": "workspace:*",
"jest-junit": "^13.0.0",
"jest-mock": "workspace:*",
"jest-runner-tsd": "^1.1.0",
"jest-runner-tsd": "^2.0.0",
"jest-silent-reporter": "^0.5.0",
"jest-snapshot": "workspace:*",
"jest-snapshot-serializer-raw": "^1.1.0",
Expand Down
9 changes: 9 additions & 0 deletions packages/expect/__typechecks__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "@tsconfig/node10/tsconfig.json",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we create a tsconfig.test.json in root which has all this stuff instead of repeating in each package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Perhaps .tsd pre-suffix is good idea? Also for jest.config.tsd.js?

"compilerOptions": {
mrazauskas marked this conversation as resolved.
Show resolved Hide resolved
"isolatedModules": true,
"skipLibCheck": true,
"strict": true
},
"include": ["**/*"]
}
2 changes: 1 addition & 1 deletion packages/jest-types/__typechecks__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import {expectAssignable} from 'mlh-tsd';
import {expectAssignable} from 'tsd-lite';
import type {Config} from '@jest/types';

expectAssignable<Config.InitialOptions>({
Expand Down
18 changes: 9 additions & 9 deletions packages/jest-types/__typechecks__/expect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import {expectError, expectType} from 'mlh-tsd';
import {expectError, expectType} from 'tsd-lite';
import {expect} from '@jest/globals';

// asymmetric matchers
Expand Down Expand Up @@ -182,26 +182,26 @@ expectError(expect(jest.fn()).toHaveBeenCalledTimes());

expectType<void>(expect(jest.fn()).toBeCalledWith('value'));
expectType<void>(expect(jest.fn()).toBeCalledWith('value', 123));
// expectError(expect(jest.fn()).toBeCalledWith());
expectError(expect(jest.fn()).toBeCalledWith());
expectType<void>(expect(jest.fn()).toHaveBeenCalledWith(123));
expectType<void>(expect(jest.fn()).toHaveBeenCalledWith(123, 'value'));
// expectError(expect(jest.fn()).toHaveBeenCalledWith());
expectError(expect(jest.fn()).toHaveBeenCalledWith());

expectType<void>(expect(jest.fn()).lastCalledWith('value'));
expectType<void>(expect(jest.fn()).lastCalledWith('value', 123));
// expectError(expect(jest.fn()).lastCalledWith());
expectError(expect(jest.fn()).lastCalledWith());
expectType<void>(expect(jest.fn()).toHaveBeenLastCalledWith(123));
expectType<void>(expect(jest.fn()).toHaveBeenLastCalledWith(123, 'value'));
// expectError(expect(jest.fn()).toHaveBeenLastCalledWith());
expectError(expect(jest.fn()).toHaveBeenLastCalledWith());

expectType<void>(expect(jest.fn()).nthCalledWith(1, 'value'));
expectType<void>(expect(jest.fn()).nthCalledWith(1, 'value', 123));
// expectError(expect(jest.fn()).nthCalledWith());
// expectError(expect(jest.fn()).nthCalledWith(2));
expectError(expect(jest.fn()).nthCalledWith());
expectError(expect(jest.fn()).nthCalledWith(2));
expectType<void>(expect(jest.fn()).toHaveBeenNthCalledWith(1, 'value'));
expectType<void>(expect(jest.fn()).toHaveBeenNthCalledWith(1, 'value', 123));
// expectError(expect(jest.fn()).toHaveBeenNthCalledWith());
// expectError(expect(jest.fn()).toHaveBeenNthCalledWith(2));
expectError(expect(jest.fn()).toHaveBeenNthCalledWith());
expectError(expect(jest.fn()).toHaveBeenNthCalledWith(2));

expectType<void>(expect(jest.fn()).toReturn());
expectError(expect(jest.fn()).toReturn('value'));
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-types/__typechecks__/globals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import {expectError, expectType} from 'mlh-tsd';
import {expectError, expectType} from 'tsd-lite';
import {
afterAll,
afterEach,
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-types/__typechecks__/jest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import {expectError, expectType} from 'mlh-tsd';
import {expectError, expectType} from 'tsd-lite';
import {jest} from '@jest/globals';
import type {Mock} from 'jest-mock';

Expand Down
9 changes: 9 additions & 0 deletions packages/jest-types/__typechecks__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "@tsconfig/node10/tsconfig.json",
"compilerOptions": {
"isolatedModules": true,
"skipLibCheck": true,
"strict": true
},
"include": ["**/*"]
}
2 changes: 1 addition & 1 deletion packages/jest-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"chalk": "^4.0.0"
},
"devDependencies": {
"mlh-tsd": "^0.14.1"
"tsd-lite": "^0.5.0"
},
"publishConfig": {
"access": "public"
Expand Down