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

feat: create new @jest/expect package #12404

Merged
merged 21 commits into from Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions packages/expect/__typetests__/expect.test.ts
Expand Up @@ -210,3 +210,7 @@ const customStateAndExpected: MatcherFunctionWithState<
};

expectAssignable<CustomStateAndExpected>(customStateAndExpected);

expectError(() => {
expect({}).toMatchSnapshot();
});
16 changes: 16 additions & 0 deletions packages/jest-expect/__typetests__/jest-expect.test.ts
@@ -0,0 +1,16 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

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

expectType<void>(jestExpect({}).toMatchSnapshot());

expectError(() => {
expect({}).toMatchSnapshot();
});
SimenB marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions packages/jest-expect/__typetests__/tsconfig.json
@@ -0,0 +1,9 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"noUnusedLocals": false,
"noUnusedParameters": false,
"skipLibCheck": true
},
"include": ["./**/*"]
}
4 changes: 4 additions & 0 deletions packages/jest-expect/package.json
Expand Up @@ -20,6 +20,10 @@
"expect": "^28.0.0-alpha.1",
"jest-snapshot": "^28.0.0-alpha.1"
},
"devDependencies": {
"@tsd/typescript": "~4.5.5",
"tsd-lite": "^0.5.1"
},
"engines": {
"node": "^12.13.0 || ^14.15.0 || ^16.13.0 || >=17.0.0"
},
Expand Down
2 changes: 2 additions & 0 deletions yarn.lock
Expand Up @@ -2593,8 +2593,10 @@ __metadata:
version: 0.0.0-use.local
resolution: "@jest/expect@workspace:packages/jest-expect"
dependencies:
"@tsd/typescript": ~4.5.5
expect: ^28.0.0-alpha.1
jest-snapshot: ^28.0.0-alpha.1
tsd-lite: ^0.5.1
languageName: unknown
linkType: soft

Expand Down