mirror of https://github.com/facebook/jest.git
chore: migrate type tests of `each` to TSTyche (#14994)
This commit is contained in:
parent
08b8634444
commit
559449e5a0
|
@ -5,14 +5,6 @@
|
|||
"rangeStrategy": "replace",
|
||||
"postUpdateOptions": ["yarnDedupeHighest"],
|
||||
"packageRules": [
|
||||
{
|
||||
"matchPackageNames": ["@tsd/typescript", "typescript"],
|
||||
"groupName": "typescript"
|
||||
},
|
||||
{
|
||||
"matchPackageNames": ["jest-runner-tsd", "tsd-lite"],
|
||||
"groupName": "tsd"
|
||||
},
|
||||
{
|
||||
"matchPackageNames": ["@lerna-lite/cli", "@lerna-lite/publish"],
|
||||
"groupName": "lerna-lite"
|
||||
|
|
|
@ -48,7 +48,7 @@ jobs:
|
|||
- name: ts integration
|
||||
run: yarn test-ts --selectProjects ts-integration
|
||||
- name: type tests
|
||||
run: yarn tstyche --target 5.0,current && yarn test-ts --selectProjects type-tests
|
||||
run: yarn test-types --target 5.0,current
|
||||
- name: verify TypeScript@5.0 compatibility
|
||||
run: yarn verify-old-ts
|
||||
- name: run ESLint with type info
|
||||
|
|
|
@ -19,16 +19,6 @@ export default {
|
|||
roots: ['<rootDir>/e2e/__tests__'],
|
||||
testMatch: ['<rootDir>/e2e/__tests__/ts*'],
|
||||
},
|
||||
{
|
||||
displayName: {
|
||||
color: 'blue',
|
||||
name: 'type-tests',
|
||||
},
|
||||
modulePathIgnorePatterns: baseConfig.modulePathIgnorePatterns,
|
||||
roots: ['<rootDir>/packages'],
|
||||
runner: 'jest-runner-tsd',
|
||||
testMatch: ['**/packages/jest-types/__typetests__/each.test.ts'],
|
||||
},
|
||||
],
|
||||
reporters: ['default', 'github-actions'],
|
||||
};
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
"@lerna-lite/publish": "^3.0.0",
|
||||
"@microsoft/api-extractor": "^7.35.0",
|
||||
"@tsconfig/node16": "^16.1.0",
|
||||
"@tsd/typescript": "^5.0.4",
|
||||
"@types/babel__core": "^7.1.14",
|
||||
"@types/babel__generator": "^7.0.0",
|
||||
"@types/babel__template": "^7.0.2",
|
||||
|
@ -55,7 +54,6 @@
|
|||
"jest-changed-files": "workspace:*",
|
||||
"jest-junit": "^16.0.0",
|
||||
"jest-mock": "workspace:*",
|
||||
"jest-runner-tsd": "^6.0.0",
|
||||
"jest-serializer-ansi-escapes": "^3.0.0",
|
||||
"jest-silent-reporter": "^0.5.0",
|
||||
"jest-snapshot": "workspace:*",
|
||||
|
@ -80,7 +78,7 @@
|
|||
"strip-json-comments": "^3.1.1",
|
||||
"tempy": "^1.0.0",
|
||||
"ts-node": "^10.5.0",
|
||||
"tstyche": "^1.0.0",
|
||||
"tstyche": "^2.0.0-beta.0",
|
||||
"typescript": "^5.0.4",
|
||||
"webpack": "^5.68.0",
|
||||
"webpack-node-externals": "^3.0.0",
|
||||
|
@ -112,7 +110,7 @@
|
|||
"test-ci-partial:parallel": "yarn jest --color --config jest.config.ci.mjs",
|
||||
"test-leak": "yarn jest -i --detectLeaks --color jest-mock jest-diff jest-repl pretty-format",
|
||||
"test-ts": "yarn jest --config jest.config.ts.mjs",
|
||||
"test-types": "yarn tstyche && yarn test-ts --selectProjects type-tests",
|
||||
"test-types": "yarn tstyche",
|
||||
"test": "yarn lint && yarn jest",
|
||||
"typecheck": "yarn typecheck:examples && yarn typecheck:tests",
|
||||
"typecheck:examples": "tsc -p examples/expect-extend && tsc -p examples/typescript",
|
||||
|
|
|
@ -30,10 +30,8 @@
|
|||
"devDependencies": {
|
||||
"@fast-check/jest": "^1.3.0",
|
||||
"@jest/test-utils": "workspace:*",
|
||||
"@tsd/typescript": "^5.0.4",
|
||||
"chalk": "^4.0.0",
|
||||
"immutable": "^4.0.0",
|
||||
"tsd-lite": "^0.8.0"
|
||||
"immutable": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
"expect": "workspace:*",
|
||||
"jest-snapshot": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsd/typescript": "^5.0.4",
|
||||
"tsd-lite": "^0.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
|
||||
},
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@jest/test-utils": "workspace:*",
|
||||
"@tsd/typescript": "^5.0.4",
|
||||
"@types/exit": "^0.1.30",
|
||||
"@types/graceful-fs": "^4.1.3",
|
||||
"@types/istanbul-lib-coverage": "^2.0.0",
|
||||
|
@ -52,8 +51,7 @@
|
|||
"@types/node-notifier": "^8.0.0",
|
||||
"jest-resolve": "workspace:*",
|
||||
"mock-fs": "^5.1.2",
|
||||
"node-notifier": "^10.0.0",
|
||||
"tsd-lite": "^0.8.0"
|
||||
"node-notifier": "^10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
|
||||
|
|
|
@ -30,11 +30,9 @@
|
|||
"slash": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsd/typescript": "^5.0.4",
|
||||
"@types/graceful-fs": "^4.1.3",
|
||||
"@types/pnpapi": "^0.0.5",
|
||||
"@types/resolve": "^1.20.2",
|
||||
"tsd-lite": "^0.8.0"
|
||||
"@types/resolve": "^1.20.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
|
||||
|
|
|
@ -43,12 +43,10 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@jest/test-utils": "workspace:*",
|
||||
"@tsd/typescript": "^5.0.4",
|
||||
"@types/exit": "^0.1.30",
|
||||
"@types/graceful-fs": "^4.1.3",
|
||||
"@types/source-map-support": "^0.5.0",
|
||||
"jest-jasmine2": "workspace:*",
|
||||
"tsd-lite": "^0.8.0"
|
||||
"jest-jasmine2": "workspace:*"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
"@babel/preset-flow": "^7.7.2",
|
||||
"@babel/preset-react": "^7.12.1",
|
||||
"@jest/test-utils": "workspace:*",
|
||||
"@tsd/typescript": "^5.0.4",
|
||||
"@types/babel__core": "^7.1.14",
|
||||
"@types/graceful-fs": "^4.1.3",
|
||||
"@types/natural-compare": "^1.4.0",
|
||||
|
@ -54,8 +53,7 @@
|
|||
"ansi-regex": "^5.0.1",
|
||||
"ansi-styles": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier-v2": "npm:prettier@^2.1.5",
|
||||
"tsd-lite": "^0.8.0"
|
||||
"prettier-v2": "npm:prettier@^2.1.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import {expectError, expectType} from 'tsd-lite';
|
||||
import {expect} from 'tstyche';
|
||||
import {describe, test} from '@jest/globals';
|
||||
|
||||
const list = [1, 2, 3];
|
||||
|
@ -27,158 +27,158 @@ const objectTable = [
|
|||
|
||||
// test.each
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.each(list)('some test', (a, done) => {
|
||||
expectType<number>(a);
|
||||
expect(a).type.toBeNumber();
|
||||
|
||||
expectType<(reason?: string | Error) => void>(done);
|
||||
expect(done).type.toBe<(reason?: string | Error) => void>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each(list)(
|
||||
'some test',
|
||||
a => {
|
||||
expectType<number>(a);
|
||||
expect(a).type.toBeNumber();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.each(tupleList)('some test', (b, done) => {
|
||||
expectType<'one' | 'two' | 'three'>(b);
|
||||
expect(b).type.toBe<'one' | 'two' | 'three'>();
|
||||
|
||||
expectType<(reason?: string | Error) => void>(done);
|
||||
expect(done).type.toBe<(reason?: string | Error) => void>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each(tupleList)(
|
||||
'some test',
|
||||
b => {
|
||||
expectType<'one' | 'two' | 'three'>(b);
|
||||
expect(b).type.toBe<'one' | 'two' | 'three'>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.each([3, 4, 'seven'])('some test', (c, done) => {
|
||||
expectType<string | number>(c);
|
||||
expect(c).type.toBe<string | number>();
|
||||
|
||||
expectType<(reason?: string | Error) => void>(done);
|
||||
expect(done).type.toBe<(reason?: string | Error) => void>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each([3, 4, 'seven'])(
|
||||
'some test',
|
||||
c => {
|
||||
expectType<string | number>(c);
|
||||
expect(c).type.toBe<string | number>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.each(table)('some test', (a, b, expected) => {
|
||||
expectType<string | number>(a);
|
||||
expectType<string | number>(b);
|
||||
expectType<string | number>(expected);
|
||||
expect(a).type.toBe<string | number>();
|
||||
expect(b).type.toBe<string | number>();
|
||||
expect(expected).type.toBe<string | number>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each(table)(
|
||||
'some test',
|
||||
(a, b, expected) => {
|
||||
expectType<string | number>(a);
|
||||
expectType<string | number>(b);
|
||||
expectType<string | number>(expected);
|
||||
expect(a).type.toBe<string | number>();
|
||||
expect(b).type.toBe<string | number>();
|
||||
expect(expected).type.toBe<string | number>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.each(tupleTable)('some test', (a, b, expected, extra) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expectType<boolean | undefined>(extra);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
expect(extra).type.toBe<boolean | undefined>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each(tupleTable)(
|
||||
'some test',
|
||||
(a, b, expected, extra) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expectType<boolean | undefined>(extra);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
expect(extra).type.toBe<boolean | undefined>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.each([
|
||||
[1, 2, 'three'],
|
||||
[3, 4, 'seven'],
|
||||
])('some test', (a, b, expected) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each([
|
||||
[1, 2, 'three'],
|
||||
[3, 4, 'seven'],
|
||||
])(
|
||||
'some test',
|
||||
(a, b, expected) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.each([
|
||||
[1, 2, 'three'],
|
||||
[3, 4, 'seven'],
|
||||
] as const)('some test', (a, b, expected) => {
|
||||
expectType<1 | 3>(a);
|
||||
expectType<2 | 4>(b);
|
||||
expectType<'three' | 'seven'>(expected);
|
||||
expect(a).type.toBe<1 | 3>();
|
||||
expect(b).type.toBe<2 | 4>();
|
||||
expect(expected).type.toBe<'three' | 'seven'>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each([
|
||||
[1, 2, 'three'],
|
||||
[3, 4, 'seven'],
|
||||
] as const)(
|
||||
'some test',
|
||||
(a, b, expected) => {
|
||||
expectType<1 | 3>(a);
|
||||
expectType<2 | 4>(b);
|
||||
expectType<'three' | 'seven'>(expected);
|
||||
expect(a).type.toBe<1 | 3>();
|
||||
expect(b).type.toBe<2 | 4>();
|
||||
expect(expected).type.toBe<'three' | 'seven'>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.each(objectTable)('some test', ({a, b, expected, extra}, done) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expectType<boolean | undefined>(extra);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
expect(extra).type.toBe<boolean | undefined>();
|
||||
|
||||
expectType<(reason?: string | Error) => void>(done);
|
||||
expect(done).type.toBe<(reason?: string | Error) => void>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each([
|
||||
{a: 1, b: 2, expected: 'three', extra: true},
|
||||
{a: 3, b: 4, expected: 'seven', extra: false},
|
||||
|
@ -186,54 +186,54 @@ expectType<void>(
|
|||
])(
|
||||
'some test',
|
||||
({a, b, expected, extra}, done) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expectType<boolean | undefined>(extra);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
expect(extra).type.toBe<boolean | undefined>();
|
||||
|
||||
expectType<(reason?: string | Error) => void>(done);
|
||||
expect(done).type.toBe<(reason?: string | Error) => void>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.each`
|
||||
a | b | expected
|
||||
${1} | ${1} | ${2}
|
||||
${1} | ${2} | ${3}
|
||||
${2} | ${1} | ${3}
|
||||
`('some test', ({a, b, expected}, done) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<number>(expected);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeNumber();
|
||||
|
||||
expectType<(reason?: string | Error) => void>(done);
|
||||
expect(done).type.toBe<(reason?: string | Error) => void>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each`
|
||||
item | expected
|
||||
${'a'} | ${true}
|
||||
${'b'} | ${false}
|
||||
`('some test', ({item, expected}) => {
|
||||
expectType<string | boolean>(item);
|
||||
expectType<string | boolean>(expected);
|
||||
expect(item).type.toBe<string | boolean>();
|
||||
expect(expected).type.toBe<string | boolean>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each<{item: string; expected: boolean}>`
|
||||
item | expected
|
||||
${'a'} | ${true}
|
||||
${'b'} | ${false}
|
||||
`('some test', ({item, expected}, done) => {
|
||||
expectType<string>(item);
|
||||
expectType<boolean>(expected);
|
||||
expect(item).type.toBeString();
|
||||
expect(expected).type.toBeBoolean();
|
||||
|
||||
expectType<(reason?: string | Error) => void>(done);
|
||||
expect(done).type.toBe<(reason?: string | Error) => void>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each`
|
||||
a | b | expected
|
||||
${1} | ${1} | ${2}
|
||||
|
@ -242,14 +242,14 @@ expectType<void>(
|
|||
`(
|
||||
'some test',
|
||||
({a, b, expected}) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<number>(expected);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeNumber();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each`
|
||||
item | expected
|
||||
${'a'} | ${true}
|
||||
|
@ -257,13 +257,13 @@ expectType<void>(
|
|||
`(
|
||||
'some test',
|
||||
({item, expected}) => {
|
||||
expectType<string | boolean>(item);
|
||||
expectType<string | boolean>(expected);
|
||||
expect(item).type.toBe<string | boolean>();
|
||||
expect(expected).type.toBe<string | boolean>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each<{item: string; expected: boolean}>`
|
||||
item | expected
|
||||
${'a'} | ${true}
|
||||
|
@ -271,143 +271,143 @@ expectType<void>(
|
|||
`(
|
||||
'some test',
|
||||
({item, expected}) => {
|
||||
expectType<string>(item);
|
||||
expectType<boolean>(expected);
|
||||
expect(item).type.toBeString();
|
||||
expect(expected).type.toBeBoolean();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectError(test.each());
|
||||
expectError(test.each('abc'));
|
||||
expectError(test.each(() => {}));
|
||||
expect(test.each()).type.toRaiseError();
|
||||
expect(test.each('abc')).type.toRaiseError();
|
||||
expect(test.each(() => {})).type.toRaiseError();
|
||||
|
||||
expectType<typeof test.each>(test.only.each);
|
||||
expectType<typeof test.each>(test.skip.each);
|
||||
expect(test.only.each).type.toBe(test.each);
|
||||
expect(test.skip.each).type.toBe(test.each);
|
||||
|
||||
// test.concurrent.each
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.concurrent.each(list)('some test', async a => {
|
||||
expectType<number>(a);
|
||||
expect(a).type.toBeNumber();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.concurrent.each(list)(
|
||||
'some test',
|
||||
async a => {
|
||||
expectType<number>(a);
|
||||
expect(a).type.toBeNumber();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.concurrent.each(tupleList)('some test', async b => {
|
||||
expectType<'one' | 'two' | 'three'>(b);
|
||||
expect(b).type.toBe<'one' | 'two' | 'three'>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.concurrent.each(tupleList)(
|
||||
'some test',
|
||||
async b => {
|
||||
expectType<'one' | 'two' | 'three'>(b);
|
||||
expect(b).type.toBe<'one' | 'two' | 'three'>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.concurrent.each([3, 4, 'seven'])('some test', async c => {
|
||||
expectType<string | number>(c);
|
||||
expect(c).type.toBe<string | number>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.concurrent.each([3, 4, 'seven'])(
|
||||
'some test',
|
||||
async c => {
|
||||
expectType<string | number>(c);
|
||||
expect(c).type.toBe<string | number>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.concurrent.each(table)('some test', async (a, b, expected) => {
|
||||
expectType<string | number>(a);
|
||||
expectType<string | number>(b);
|
||||
expectType<string | number>(expected);
|
||||
expect(a).type.toBe<string | number>();
|
||||
expect(b).type.toBe<string | number>();
|
||||
expect(expected).type.toBe<string | number>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.concurrent.each(table)(
|
||||
'some test',
|
||||
async (a, b, expected) => {
|
||||
expectType<string | number>(a);
|
||||
expectType<string | number>(b);
|
||||
expectType<string | number>(expected);
|
||||
expect(a).type.toBe<string | number>();
|
||||
expect(b).type.toBe<string | number>();
|
||||
expect(expected).type.toBe<string | number>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.concurrent.each(tupleTable)(
|
||||
'some test',
|
||||
async (a, b, expected, extra) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expectType<boolean | undefined>(extra);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
expect(extra).type.toBe<boolean | undefined>();
|
||||
},
|
||||
),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.concurrent.each(tupleTable)(
|
||||
'some test',
|
||||
async (a, b, expected, extra) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expectType<boolean | undefined>(extra);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
expect(extra).type.toBe<boolean | undefined>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.concurrent.each`
|
||||
a | b | expected
|
||||
${1} | ${1} | ${2}
|
||||
${1} | ${2} | ${3}
|
||||
${2} | ${1} | ${3}
|
||||
`('some test', async ({a, b, expected}) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<number>(expected);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeNumber();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.concurrent.each`
|
||||
item | expected
|
||||
${'a'} | ${true}
|
||||
${'b'} | ${false}
|
||||
`('some test', async ({item, expected}) => {
|
||||
expectType<string | boolean>(item);
|
||||
expectType<string | boolean>(expected);
|
||||
expect(item).type.toBe<string | boolean>();
|
||||
expect(expected).type.toBe<string | boolean>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.concurrent.each<{item: string; expected: boolean}>`
|
||||
item | expected
|
||||
${'a'} | ${true}
|
||||
${'b'} | ${false}
|
||||
`('some test', async ({item, expected}) => {
|
||||
expectType<string>(item);
|
||||
expectType<boolean>(expected);
|
||||
expect(item).type.toBeString();
|
||||
expect(expected).type.toBeBoolean();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.concurrent.each`
|
||||
a | b | expected
|
||||
${1} | ${1} | ${2}
|
||||
|
@ -416,15 +416,15 @@ expectType<void>(
|
|||
`(
|
||||
'some test',
|
||||
async ({a, b, expected}) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<number>(expected);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeNumber();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
test.each`
|
||||
item | expected
|
||||
${'a'} | ${true}
|
||||
|
@ -432,13 +432,13 @@ expectType<void>(
|
|||
`(
|
||||
'some test',
|
||||
({item, expected}) => {
|
||||
expectType<string | boolean>(item);
|
||||
expectType<string | boolean>(expected);
|
||||
expect(item).type.toBe<string | boolean>();
|
||||
expect(expected).type.toBe<string | boolean>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
test.each<{item: string; expected: boolean}>`
|
||||
item | expected
|
||||
${'a'} | ${true}
|
||||
|
@ -446,166 +446,166 @@ expectType<void>(
|
|||
`(
|
||||
'some test',
|
||||
({item, expected}) => {
|
||||
expectType<string>(item);
|
||||
expectType<boolean>(expected);
|
||||
expect(item).type.toBeString();
|
||||
expect(expected).type.toBeBoolean();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectError(test.concurrent.each());
|
||||
expectError(test.concurrent.each('abc'));
|
||||
expectError(test.concurrent.each(() => {}));
|
||||
expect(test.concurrent.each()).type.toRaiseError();
|
||||
expect(test.concurrent.each('abc')).type.toRaiseError();
|
||||
expect(test.concurrent.each(() => {})).type.toRaiseError();
|
||||
|
||||
expectType<typeof test.concurrent.each>(test.concurrent.only.each);
|
||||
expectType<typeof test.concurrent.each>(test.concurrent.skip.each);
|
||||
expect(test.concurrent.only.each).type.toBe(test.concurrent.each);
|
||||
expect(test.concurrent.skip.each).type.toBe(test.concurrent.each);
|
||||
|
||||
// describe.each
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
describe.each(list)('describe each', a => {
|
||||
expectType<number>(a);
|
||||
expect(a).type.toBeNumber();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
describe.each(list)(
|
||||
'describe each',
|
||||
a => {
|
||||
expectType<number>(a);
|
||||
expect(a).type.toBeNumber();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
describe.each(tupleList)('describe each', b => {
|
||||
expectType<'one' | 'two' | 'three'>(b);
|
||||
expect(b).type.toBe<'one' | 'two' | 'three'>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
describe.each(tupleList)(
|
||||
'describe each',
|
||||
b => {
|
||||
expectType<'one' | 'two' | 'three'>(b);
|
||||
expect(b).type.toBe<'one' | 'two' | 'three'>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
describe.each([3, 4, 'seven'])('describe each', c => {
|
||||
expectType<string | number>(c);
|
||||
expect(c).type.toBe<string | number>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
describe.each([3, 4, 'seven'])(
|
||||
'describe each',
|
||||
c => {
|
||||
expectType<string | number>(c);
|
||||
expect(c).type.toBe<string | number>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
describe.each(table)('describe each', (a, b, expected) => {
|
||||
expectType<string | number>(a);
|
||||
expectType<string | number>(b);
|
||||
expectType<string | number>(expected);
|
||||
expect(a).type.toBe<string | number>();
|
||||
expect(b).type.toBe<string | number>();
|
||||
expect(expected).type.toBe<string | number>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
describe.each(table)(
|
||||
'describe each',
|
||||
(a, b, expected) => {
|
||||
expectType<string | number>(a);
|
||||
expectType<string | number>(b);
|
||||
expectType<string | number>(expected);
|
||||
expect(a).type.toBe<string | number>();
|
||||
expect(b).type.toBe<string | number>();
|
||||
expect(expected).type.toBe<string | number>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
describe.each(tupleTable)('describe each', (a, b, expected, extra) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expectType<boolean | undefined>(extra);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
expect(extra).type.toBe<boolean | undefined>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
describe.each(tupleTable)(
|
||||
'describe each',
|
||||
(a, b, expected, extra) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expectType<boolean | undefined>(extra);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
expect(extra).type.toBe<boolean | undefined>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
describe.each([
|
||||
[1, 2, 'three'],
|
||||
[3, 4, 'seven'],
|
||||
])('describe each', (a, b, expected) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
describe.each([
|
||||
[1, 2, 'three'],
|
||||
[3, 4, 'seven'],
|
||||
])(
|
||||
'describe each',
|
||||
(a, b, expected) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
describe.each([
|
||||
[1, 2, 'three'],
|
||||
[3, 4, 'seven'],
|
||||
] as const)('describe each', (a, b, expected) => {
|
||||
expectType<1 | 3>(a);
|
||||
expectType<2 | 4>(b);
|
||||
expectType<'three' | 'seven'>(expected);
|
||||
expect(a).type.toBe<1 | 3>();
|
||||
expect(b).type.toBe<2 | 4>();
|
||||
expect(expected).type.toBe<'three' | 'seven'>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
describe.each([
|
||||
[1, 2, 'three'],
|
||||
[3, 4, 'seven'],
|
||||
] as const)(
|
||||
'describe each',
|
||||
(a, b, expected) => {
|
||||
expectType<1 | 3>(a);
|
||||
expectType<2 | 4>(b);
|
||||
expectType<'three' | 'seven'>(expected);
|
||||
expect(a).type.toBe<1 | 3>();
|
||||
expect(b).type.toBe<2 | 4>();
|
||||
expect(expected).type.toBe<'three' | 'seven'>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
describe.each(objectTable)('describe each', ({a, b, expected, extra}) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expectType<boolean | undefined>(extra);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
expect(extra).type.toBe<boolean | undefined>();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
describe.each([
|
||||
{a: 1, b: 2, expected: 'three', extra: true},
|
||||
{a: 3, b: 4, expected: 'seven', extra: false},
|
||||
|
@ -613,28 +613,28 @@ expectType<void>(
|
|||
])(
|
||||
'describe each',
|
||||
({a, b, expected, extra}) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expectType<boolean | undefined>(extra);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
expect(extra).type.toBe<boolean | undefined>();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectType<void>(
|
||||
expect(
|
||||
describe.each`
|
||||
a | b | expected
|
||||
${1} | ${1} | ${2}
|
||||
${1} | ${2} | ${3}
|
||||
${2} | ${1} | ${3}
|
||||
`('describe each', ({a, b, expected}) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<number>(expected);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeNumber();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
describe.each<{
|
||||
a: number;
|
||||
b: number;
|
||||
|
@ -645,12 +645,12 @@ expectType<void>(
|
|||
${1} | ${2} | ${3}
|
||||
${2} | ${1} | ${3}
|
||||
`('describe each', ({a, b, expected}) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
}),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
describe.each`
|
||||
a | b | expected
|
||||
${1} | ${1} | ${2}
|
||||
|
@ -659,14 +659,14 @@ expectType<void>(
|
|||
`(
|
||||
'describe each',
|
||||
({a, b, expected}) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<number>(expected);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeNumber();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
expectType<void>(
|
||||
).type.toBeVoid();
|
||||
expect(
|
||||
describe.each<{
|
||||
a: number;
|
||||
b: number;
|
||||
|
@ -679,17 +679,17 @@ expectType<void>(
|
|||
`(
|
||||
'describe each',
|
||||
({a, b, expected}) => {
|
||||
expectType<number>(a);
|
||||
expectType<number>(b);
|
||||
expectType<string>(expected);
|
||||
expect(a).type.toBeNumber();
|
||||
expect(b).type.toBeNumber();
|
||||
expect(expected).type.toBeString();
|
||||
},
|
||||
1000,
|
||||
),
|
||||
);
|
||||
).type.toBeVoid();
|
||||
|
||||
expectError(describe.each());
|
||||
expectError(describe.each('abc'));
|
||||
expectError(describe.each(() => {}));
|
||||
expect(describe.each()).type.toRaiseError();
|
||||
expect(describe.each('abc')).type.toRaiseError();
|
||||
expect(describe.each(() => {})).type.toRaiseError();
|
||||
|
||||
expectType<typeof describe.each>(describe.only.each);
|
||||
expectType<typeof describe.each>(describe.skip.each);
|
||||
expect(describe.only.each).type.toBe(describe.each);
|
||||
expect(describe.skip.each).type.toBe(describe.each);
|
||||
|
|
|
@ -27,10 +27,6 @@
|
|||
"@types/yargs": "^17.0.8",
|
||||
"chalk": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsd/typescript": "^5.0.4",
|
||||
"tsd-lite": "^0.8.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
|
|
|
@ -26,12 +26,10 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.11.6",
|
||||
"@tsd/typescript": "^5.0.4",
|
||||
"@types/merge-stream": "^1.1.2",
|
||||
"@types/supports-color": "^8.1.0",
|
||||
"get-stream": "^6.0.0",
|
||||
"jest-leak-detector": "workspace:*",
|
||||
"tsd-lite": "^0.8.0",
|
||||
"worker-farm": "^1.6.0"
|
||||
},
|
||||
"engines": {
|
||||
|
|
|
@ -18,14 +18,9 @@ const require = createRequire(import.meta.url);
|
|||
|
||||
const rootPackageJson = require('../package.json');
|
||||
|
||||
const currentTsdTypescriptVersion =
|
||||
rootPackageJson.devDependencies['@tsd/typescript'];
|
||||
const currentTypescriptVersion = rootPackageJson.devDependencies['typescript'];
|
||||
const tsconfigBasePackage = Object.keys(rootPackageJson.devDependencies).find(
|
||||
packageName => packageName.startsWith('@tsconfig'),
|
||||
);
|
||||
const apiExtractorTypescriptVersion =
|
||||
require('@microsoft/api-extractor/package.json').dependencies['typescript'];
|
||||
/* eslint-enable import/order */
|
||||
|
||||
const baseTsConfig = JSON.parse(
|
||||
|
@ -87,151 +82,6 @@ function smoketest() {
|
|||
}
|
||||
}
|
||||
|
||||
function typeTests() {
|
||||
const cwd = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../');
|
||||
|
||||
try {
|
||||
const {stdout: statusStdout} = execa.sync(
|
||||
'git',
|
||||
['status', '--porcelain'],
|
||||
{cwd},
|
||||
);
|
||||
|
||||
if (statusStdout.length > 0) {
|
||||
throw new Error(
|
||||
'Repo is not clean - cannot run type tests with old typescript version',
|
||||
);
|
||||
}
|
||||
|
||||
execa.sync('yarn', ['add', tsconfigBasePackage], {cwd});
|
||||
|
||||
execa.sync(
|
||||
'yarn',
|
||||
[
|
||||
'set',
|
||||
'resolution',
|
||||
`@tsd/typescript@npm:${currentTsdTypescriptVersion}`,
|
||||
tsVersion,
|
||||
],
|
||||
{cwd},
|
||||
);
|
||||
|
||||
verifyInstalledTsdTypescript();
|
||||
|
||||
execa.sync(
|
||||
'yarn',
|
||||
[
|
||||
'set',
|
||||
'resolution',
|
||||
`typescript@npm:${currentTypescriptVersion}`,
|
||||
tsVersion,
|
||||
],
|
||||
{cwd},
|
||||
);
|
||||
execa.sync(
|
||||
'yarn',
|
||||
[
|
||||
'set',
|
||||
'resolution',
|
||||
`typescript@npm:${apiExtractorTypescriptVersion}`,
|
||||
tsVersion,
|
||||
],
|
||||
{cwd},
|
||||
);
|
||||
execa.sync('yarn', ['set', 'resolution', 'typescript@npm:*', tsVersion], {
|
||||
cwd,
|
||||
});
|
||||
|
||||
verifyInstalledTypescript();
|
||||
|
||||
execa.sync('yarn', ['test-ts', '--selectProjects', 'type-tests'], {
|
||||
cwd,
|
||||
stdio: 'inherit',
|
||||
});
|
||||
} finally {
|
||||
execa.sync('git', ['checkout', 'package.json', 'yarn.lock'], {cwd});
|
||||
execa.sync('yarn', ['install'], {cwd});
|
||||
}
|
||||
|
||||
function verifyInstalledTsdTypescript() {
|
||||
const tsdEntries = listInstalledVersion('@tsd/typescript');
|
||||
|
||||
if (tsdEntries.length !== 1) {
|
||||
throw new Error(
|
||||
`More than one version of @tsd/typescript found: ${tsdEntries.join(
|
||||
', ',
|
||||
)}`,
|
||||
);
|
||||
}
|
||||
|
||||
const tsdVersion = tsdEntries[0].match(/@npm:(\d+\.\d+)\.\d+/);
|
||||
|
||||
if (!tsdVersion) {
|
||||
throw new Error('Unable to verify installed version of @tsd/typescript');
|
||||
}
|
||||
|
||||
if (tsdVersion[1] !== tsVersion) {
|
||||
throw new Error(
|
||||
`Installed TSD version is not ${tsVersion}, is ${tsdVersion[1]}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function verifyInstalledTypescript() {
|
||||
const typescriptEntries = listInstalledVersion('typescript');
|
||||
|
||||
if (typescriptEntries.length !== 1) {
|
||||
throw new Error(
|
||||
`More than one version of typescript found: ${typescriptEntries.join(
|
||||
', ',
|
||||
)}`,
|
||||
);
|
||||
}
|
||||
|
||||
const tsdVersion = typescriptEntries[0].match(/@npm%3A(\d+\.\d+)\.\d+/);
|
||||
|
||||
if (!tsdVersion) {
|
||||
throw new Error('Unable to verify installed version of typescript');
|
||||
}
|
||||
|
||||
if (tsdVersion[1] !== tsVersion) {
|
||||
throw new Error(
|
||||
`Installed TSD version is not ${tsVersion}, is ${tsdVersion[1]}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function listInstalledVersion(module) {
|
||||
const {stdout: tsdWhyOutput} = execa.sync(
|
||||
'yarn',
|
||||
['why', module, '--json'],
|
||||
{cwd},
|
||||
);
|
||||
|
||||
const locators = tsdWhyOutput
|
||||
.split('\n')
|
||||
.map(JSON.parse)
|
||||
.map(entry => {
|
||||
const entries = Object.entries(entry.children);
|
||||
if (entries.length !== 1) {
|
||||
throw new Error(
|
||||
`More than one entry found in ${JSON.stringify(entry, null, 2)}`,
|
||||
);
|
||||
}
|
||||
|
||||
return entries[0][1].locator;
|
||||
});
|
||||
|
||||
return [...new Set(locators)];
|
||||
}
|
||||
}
|
||||
|
||||
console.log(chalk.inverse(` Running smoketest using TypeScript@${tsVersion} `));
|
||||
smoketest();
|
||||
console.log(chalk.inverse.green(' Successfully ran smoketest '));
|
||||
|
||||
console.log(
|
||||
chalk.inverse(` Running type tests using TypeScript@${tsVersion} `),
|
||||
);
|
||||
typeTests();
|
||||
console.log(chalk.inverse.green(' Successfully ran type tests '));
|
||||
|
|
|
@ -1,19 +1,3 @@
|
|||
{
|
||||
"testFileMatch": [
|
||||
"packages/expect/__typetests__/*.test.ts",
|
||||
"packages/expect-utils/__typetests__/*.test.ts",
|
||||
"packages/jest/__typetests__/*.test.ts",
|
||||
"packages/jest-cli/__typetests__/*.test.ts",
|
||||
"packages/jest-expect/__typetests__/*.test.ts",
|
||||
"packages/jest-mock/__typetests__/*.test.ts",
|
||||
"packages/jest-reporters/__typetests__/*.test.ts",
|
||||
"packages/jest-resolve/__typetests__/*.test.ts",
|
||||
"packages/jest-runner/__typetests__/*.test.ts",
|
||||
"packages/jest-snapshot/__typetests__/*.test.ts",
|
||||
"packages/jest-types/__typetests__/config.test.ts",
|
||||
"packages/jest-types/__typetests__/expect.test.ts",
|
||||
"packages/jest-types/__typetests__/globals.test.ts",
|
||||
"packages/jest-types/__typetests__/jest.test.ts",
|
||||
"packages/jest-worker/__typetests__/*.test.ts"
|
||||
]
|
||||
"testFileMatch": ["packages/*/__typetests__/*.test.ts"]
|
||||
}
|
||||
|
|
83
yarn.lock
83
yarn.lock
|
@ -306,7 +306,7 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.15.8, @babel/code-frame@npm:^7.16.0, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.23.5, @babel/code-frame@npm:^7.24.2, @babel/code-frame@npm:^7.8.3":
|
||||
"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.0, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.23.5, @babel/code-frame@npm:^7.24.2, @babel/code-frame@npm:^7.8.3":
|
||||
version: 7.24.2
|
||||
resolution: "@babel/code-frame@npm:7.24.2"
|
||||
dependencies:
|
||||
|
@ -2995,10 +2995,8 @@ __metadata:
|
|||
version: 0.0.0-use.local
|
||||
resolution: "@jest/expect@workspace:packages/jest-expect"
|
||||
dependencies:
|
||||
"@tsd/typescript": ^5.0.4
|
||||
expect: "workspace:*"
|
||||
jest-snapshot: "workspace:*"
|
||||
tsd-lite: ^0.8.0
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
|
@ -3045,7 +3043,6 @@ __metadata:
|
|||
"@lerna-lite/publish": ^3.0.0
|
||||
"@microsoft/api-extractor": ^7.35.0
|
||||
"@tsconfig/node16": ^16.1.0
|
||||
"@tsd/typescript": ^5.0.4
|
||||
"@types/babel__core": ^7.1.14
|
||||
"@types/babel__generator": ^7.0.0
|
||||
"@types/babel__template": ^7.0.2
|
||||
|
@ -3084,7 +3081,6 @@ __metadata:
|
|||
jest-changed-files: "workspace:*"
|
||||
jest-junit: ^16.0.0
|
||||
jest-mock: "workspace:*"
|
||||
jest-runner-tsd: ^6.0.0
|
||||
jest-serializer-ansi-escapes: ^3.0.0
|
||||
jest-silent-reporter: ^0.5.0
|
||||
jest-snapshot: "workspace:*"
|
||||
|
@ -3109,7 +3105,7 @@ __metadata:
|
|||
strip-json-comments: ^3.1.1
|
||||
tempy: ^1.0.0
|
||||
ts-node: ^10.5.0
|
||||
tstyche: ^1.0.0
|
||||
tstyche: ^2.0.0-beta.0
|
||||
typescript: ^5.0.4
|
||||
webpack: ^5.68.0
|
||||
webpack-node-externals: ^3.0.0
|
||||
|
@ -3128,7 +3124,6 @@ __metadata:
|
|||
"@jest/transform": "workspace:*"
|
||||
"@jest/types": "workspace:*"
|
||||
"@jridgewell/trace-mapping": ^0.3.18
|
||||
"@tsd/typescript": ^5.0.4
|
||||
"@types/exit": ^0.1.30
|
||||
"@types/graceful-fs": ^4.1.3
|
||||
"@types/istanbul-lib-coverage": ^2.0.0
|
||||
|
@ -3157,7 +3152,6 @@ __metadata:
|
|||
slash: ^3.0.0
|
||||
string-length: ^4.0.1
|
||||
strip-ansi: ^6.0.0
|
||||
tsd-lite: ^0.8.0
|
||||
v8-to-istanbul: ^9.0.1
|
||||
peerDependencies:
|
||||
node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
|
||||
|
@ -3320,13 +3314,11 @@ __metadata:
|
|||
resolution: "@jest/types@workspace:packages/jest-types"
|
||||
dependencies:
|
||||
"@jest/schemas": "workspace:*"
|
||||
"@tsd/typescript": ^5.0.4
|
||||
"@types/istanbul-lib-coverage": ^2.0.0
|
||||
"@types/istanbul-reports": ^3.0.0
|
||||
"@types/node": "*"
|
||||
"@types/yargs": ^17.0.8
|
||||
chalk: ^4.0.0
|
||||
tsd-lite: ^0.8.0
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
|
@ -4891,13 +4883,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@tsd/typescript@npm:^5.0.4":
|
||||
version: 5.4.5
|
||||
resolution: "@tsd/typescript@npm:5.4.5"
|
||||
checksum: 86498d5e15d9395ab428c121be7e87baf3d03f5b6e513c35662a7a76e185ed7b52d7d3cd7a7c374db40ccae0081ddd68c79bfbe9d783b8fea79d3384690f33d1
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@tufjs/canonical-json@npm:2.0.0":
|
||||
version: 2.0.0
|
||||
resolution: "@tufjs/canonical-json@npm:2.0.0"
|
||||
|
@ -8102,27 +8087,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"create-jest-runner@npm:^0.12.0":
|
||||
version: 0.12.3
|
||||
resolution: "create-jest-runner@npm:0.12.3"
|
||||
dependencies:
|
||||
chalk: ^4.1.0
|
||||
jest-worker: ^29.5.0
|
||||
p-limit: ^3.1.0
|
||||
peerDependencies:
|
||||
"@jest/test-result": ^28.0.0 || ^29.0.0
|
||||
jest-runner: ^28.0.0 || ^29.0.0
|
||||
peerDependenciesMeta:
|
||||
"@jest/test-result":
|
||||
optional: true
|
||||
jest-runner:
|
||||
optional: true
|
||||
bin:
|
||||
create-jest-runner: generator/index.js
|
||||
checksum: 2bfe18cb8b572ef772f10a6c70a2e47bdfbe105f6877ed6d7107e92bae5f63990a3405ff7d171b4fe69946ee5c188205a7ce12438732094048b10fa649f0f66a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"create-jest@workspace:packages/create-jest":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "create-jest@workspace:packages/create-jest"
|
||||
|
@ -10070,14 +10034,12 @@ __metadata:
|
|||
"@fast-check/jest": ^1.3.0
|
||||
"@jest/expect-utils": "workspace:*"
|
||||
"@jest/test-utils": "workspace:*"
|
||||
"@tsd/typescript": ^5.0.4
|
||||
chalk: ^4.0.0
|
||||
immutable: ^4.0.0
|
||||
jest-get-type: "workspace:*"
|
||||
jest-matcher-utils: "workspace:*"
|
||||
jest-message-util: "workspace:*"
|
||||
jest-util: "workspace:*"
|
||||
tsd-lite: ^0.8.0
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
|
@ -13105,7 +13067,6 @@ __metadata:
|
|||
version: 0.0.0-use.local
|
||||
resolution: "jest-resolve@workspace:packages/jest-resolve"
|
||||
dependencies:
|
||||
"@tsd/typescript": ^5.0.4
|
||||
"@types/graceful-fs": ^4.1.3
|
||||
"@types/pnpapi": ^0.0.5
|
||||
"@types/resolve": ^1.20.2
|
||||
|
@ -13118,24 +13079,9 @@ __metadata:
|
|||
resolve: ^1.20.0
|
||||
resolve.exports: ^2.0.0
|
||||
slash: ^3.0.0
|
||||
tsd-lite: ^0.8.0
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"jest-runner-tsd@npm:^6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "jest-runner-tsd@npm:6.0.0"
|
||||
dependencies:
|
||||
"@babel/code-frame": ^7.15.8
|
||||
chalk: ^4.1.2
|
||||
create-jest-runner: ^0.12.0
|
||||
tsd-lite: ^0.8.0
|
||||
peerDependencies:
|
||||
"@tsd/typescript": 4.x || 5.x
|
||||
checksum: fb2cf2bfc3ea8b00ffba80aaa3e9c4d1e0ee3597ecadc135ec220e5576d28e610eade3e62d4134584a7e72fea1308e292f7ae2a9e2ebdf70666e4fa64c19ce39
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"jest-runner@workspace:*, jest-runner@workspace:packages/jest-runner":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "jest-runner@workspace:packages/jest-runner"
|
||||
|
@ -13146,7 +13092,6 @@ __metadata:
|
|||
"@jest/test-utils": "workspace:*"
|
||||
"@jest/transform": "workspace:*"
|
||||
"@jest/types": "workspace:*"
|
||||
"@tsd/typescript": ^5.0.4
|
||||
"@types/exit": ^0.1.30
|
||||
"@types/graceful-fs": ^4.1.3
|
||||
"@types/node": "*"
|
||||
|
@ -13167,7 +13112,6 @@ __metadata:
|
|||
jest-worker: "workspace:*"
|
||||
p-limit: ^3.1.0
|
||||
source-map-support: 0.5.13
|
||||
tsd-lite: ^0.8.0
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
|
@ -13237,7 +13181,6 @@ __metadata:
|
|||
"@jest/test-utils": "workspace:*"
|
||||
"@jest/transform": "workspace:*"
|
||||
"@jest/types": "workspace:*"
|
||||
"@tsd/typescript": ^5.0.4
|
||||
"@types/babel__core": ^7.1.14
|
||||
"@types/graceful-fs": ^4.1.3
|
||||
"@types/natural-compare": ^1.4.0
|
||||
|
@ -13260,7 +13203,6 @@ __metadata:
|
|||
pretty-format: "workspace:*"
|
||||
semver: ^7.5.3
|
||||
synckit: ^0.9.0
|
||||
tsd-lite: ^0.8.0
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
|
@ -13424,7 +13366,7 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"jest-worker@npm:^29.4.3, jest-worker@npm:^29.5.0, jest-worker@npm:^29.6.3":
|
||||
"jest-worker@npm:^29.4.3, jest-worker@npm:^29.6.3":
|
||||
version: 29.7.0
|
||||
resolution: "jest-worker@npm:29.7.0"
|
||||
dependencies:
|
||||
|
@ -13441,7 +13383,6 @@ __metadata:
|
|||
resolution: "jest-worker@workspace:packages/jest-worker"
|
||||
dependencies:
|
||||
"@babel/core": ^7.11.6
|
||||
"@tsd/typescript": ^5.0.4
|
||||
"@types/merge-stream": ^1.1.2
|
||||
"@types/node": "*"
|
||||
"@types/supports-color": ^8.1.0
|
||||
|
@ -13450,7 +13391,6 @@ __metadata:
|
|||
jest-util: "workspace:*"
|
||||
merge-stream: ^2.0.0
|
||||
supports-color: ^8.0.0
|
||||
tsd-lite: ^0.8.0
|
||||
worker-farm: ^1.6.0
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
@ -20222,15 +20162,6 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tsd-lite@npm:^0.8.0":
|
||||
version: 0.8.2
|
||||
resolution: "tsd-lite@npm:0.8.2"
|
||||
peerDependencies:
|
||||
"@tsd/typescript": 4.x || 5.x
|
||||
checksum: c9da2b929dc66c785bf0df463ff26cb2761c06a99d6ebd0a11cf21ce49e808bef5c99fbbfe953cc7f9db1a916f80fecbee0f688cf0300c44d41c5bc41ee3c0c4
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.2.0, tslib@npm:^2.3.0, tslib@npm:^2.6.0, tslib@npm:^2.6.2":
|
||||
version: 2.6.2
|
||||
resolution: "tslib@npm:2.6.2"
|
||||
|
@ -20238,9 +20169,9 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tstyche@npm:^1.0.0":
|
||||
version: 1.1.0
|
||||
resolution: "tstyche@npm:1.1.0"
|
||||
"tstyche@npm:^2.0.0-beta.0":
|
||||
version: 2.0.0-beta.0
|
||||
resolution: "tstyche@npm:2.0.0-beta.0"
|
||||
peerDependencies:
|
||||
typescript: 4.x || 5.x
|
||||
peerDependenciesMeta:
|
||||
|
@ -20248,7 +20179,7 @@ __metadata:
|
|||
optional: true
|
||||
bin:
|
||||
tstyche: build/bin.js
|
||||
checksum: 8e2dcf4451b30c3d54eb2442a83ab8f5648b4bc5b12b0b18e94812025d3f18c1b48c4521cff880aa5b82a35e318287aa0710a27c710c6517d68ebeddf89d2701
|
||||
checksum: 3b8d08111c5f6a13febc5ed65e403e667006c34c173d69c9ec087865ae18686699f8eb436b348d421544abdafb85adf0615450fe9114f3837cc1230afe6c19b2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
|
Loading…
Reference in New Issue