Skip to content

Commit

Permalink
chore: move typecheck test files from root into packages (#12099)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrazauskas committed Nov 30, 2021
1 parent 40a9027 commit 30a69fb
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .eslintrc.js
Expand Up @@ -234,7 +234,7 @@ module.exports = {
},
},
{
files: ['test-types/*.test.ts', '*.md'],
files: ['**/__typechecks__/**', '*.md'],
rules: {
'jest/no-focused-tests': 'off',
'jest/no-identical-title': 'off',
Expand Down Expand Up @@ -301,9 +301,9 @@ module.exports = {
'error',
{
devDependencies: [
'/test-types/**',
'**/__tests__/**',
'**/__mocks__/**',
'**/__tests__/**',
'**/__typechecks__/**',
'**/?(*.)(spec|test).js?(x)',
'scripts/**',
'babel.config.js',
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Expand Up @@ -35,8 +35,8 @@ module.exports = {
require.resolve('jest-snapshot-serializer-raw'),
],
testPathIgnorePatterns: [
'/test-types/',
'/__arbitraries__/',
'/__typechecks__/',
'/node_modules/',
'/examples/',
'/e2e/.*/__tests__',
Expand Down
20 changes: 3 additions & 17 deletions jest.config.types.js
Expand Up @@ -7,29 +7,15 @@

'use strict';

const assert = require('assert');
const baseConfig = require('./jest.config');

const {
modulePathIgnorePatterns,
testPathIgnorePatterns,
watchPathIgnorePatterns,
} = baseConfig;

assert.strictEqual(
testPathIgnorePatterns[0],
'/test-types/',
'First entry must be types',
);
const {modulePathIgnorePatterns} = require('./jest.config');

module.exports = {
displayName: {
color: 'blue',
name: 'types',
},
modulePathIgnorePatterns,
roots: ['<rootDir>/packages'],
runner: 'jest-runner-tsd',
testMatch: ['<rootDir>/test-types/*.test.ts'],
testPathIgnorePatterns: testPathIgnorePatterns.slice(1),
watchPathIgnorePatterns,
testMatch: ['**/__typechecks__/**/*.ts'],
};
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -62,7 +62,6 @@
"jquery": "^3.2.1",
"lerna": "^4.0.0",
"micromatch": "^4.0.4",
"mlh-tsd": "^0.14.1",
"mock-fs": "^4.4.1",
"netlify-plugin-cache": "^1.0.3",
"node-notifier": "^10.0.0",
Expand Down
Expand Up @@ -9,5 +9,5 @@ import type * as expect from 'expect';

export type M = expect.Matchers<void, unknown>;
export type N = expect.Matchers<void>;
// @ts-expect-error
export type E = expect.Matchers<>;
// @ts-expect-error: Generic type 'Matchers<R, T>' requires between 1 and 2 type arguments.
export type E = expect.Matchers;
3 changes: 2 additions & 1 deletion packages/expect/package.json
Expand Up @@ -30,7 +30,8 @@
"@jest/test-utils": "^27.4.0",
"chalk": "^4.0.0",
"fast-check": "^2.0.0",
"immutable": "^4.0.0-rc.12"
"immutable": "^4.0.0-rc.12",
"mlh-tsd": "^0.14.1"
},
"engines": {
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/jest-types/package.json
Expand Up @@ -26,6 +26,9 @@
"@types/yargs": "^16.0.0",
"chalk": "^4.0.0"
},
"devDependencies": {
"mlh-tsd": "^0.14.1"
},
"publishConfig": {
"access": "public"
}
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Expand Up @@ -26,8 +26,9 @@
},
"exclude": [
".yarn/releases/*",
"**/__tests__/**/*",
"**/__mocks__/**/*",
"**/__tests__/**/*",
"**/__typechecks__/**/*",
"**/build/**/*"
]
}
3 changes: 2 additions & 1 deletion yarn.lock
Expand Up @@ -2613,7 +2613,6 @@ __metadata:
jquery: ^3.2.1
lerna: ^4.0.0
micromatch: ^4.0.4
mlh-tsd: ^0.14.1
mock-fs: ^4.4.1
netlify-plugin-cache: ^1.0.3
node-notifier: ^10.0.0
Expand Down Expand Up @@ -2775,6 +2774,7 @@ __metadata:
"@types/node": "*"
"@types/yargs": ^16.0.0
chalk: ^4.0.0
mlh-tsd: ^0.14.1
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -9813,6 +9813,7 @@ __metadata:
jest-matcher-utils: ^27.4.0
jest-message-util: ^27.4.0
jest-regex-util: ^27.4.0
mlh-tsd: ^0.14.1
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 30a69fb

Please sign in to comment.