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: add typecheck for expect tests #13383

Merged
merged 11 commits into from Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -113,7 +113,7 @@
"test": "yarn lint && yarn jest",
"typecheck": "yarn typecheck:examples && yarn typecheck:tests",
"typecheck:examples": "tsc -p examples/angular --noEmit && tsc -p examples/expect-extend --noEmit && tsc -p examples/typescript --noEmit",
"typecheck:tests": "tsc -b packages/{babel-jest,babel-plugin-jest-hoist,diff-sequences}/src/__tests__",
"typecheck:tests": "tsc -b packages/{babel-jest,babel-plugin-jest-hoist,diff-sequences,expect}/src/__tests__",
"verify-old-ts": "node ./scripts/verifyOldTs.mjs",
"verify-pnp": "node ./scripts/verifyPnP.mjs",
"watch": "yarn build:js && node ./scripts/watch.mjs",
Expand Down
Expand Up @@ -242,6 +242,29 @@ Received
Number of returns: <r>3</>
`;

exports[`lastReturnedWith returnedWith incomplete recursive calls are handled properly 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>lastReturnedWith<d>(</><g>expected</><d>)</>

Expected: <g>undefined</>
Received
3: function call has not returned yet
-> 4: function call has not returned yet

Number of returns: <r>0</>
Number of calls: <r>4</>
`;

exports[`lastReturnedWith returnedWith works with more calls than the limit 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>lastReturnedWith<d>(</><g>expected</><d>)</>

Expected: <g>"bar"</>
Received
5: <r>"foo5"</>
-> 6: <r>"foo6"</>

Number of returns: <r>6</>
`;

exports[`lastReturnedWith works only on spies or jest.fn 1`] = `
<d>expect(</><r>received</><d>).</>lastReturnedWith<d>(</><g>expected</><d>)</>

Expand Down Expand Up @@ -2060,6 +2083,29 @@ Received
Number of returns: <r>3</>
`;

exports[`toHaveLastReturnedWith returnedWith incomplete recursive calls are handled properly 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>toHaveLastReturnedWith<d>(</><g>expected</><d>)</>

Expected: <g>undefined</>
Received
3: function call has not returned yet
-> 4: function call has not returned yet

Number of returns: <r>0</>
Number of calls: <r>4</>
`;

exports[`toHaveLastReturnedWith returnedWith works with more calls than the limit 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>toHaveLastReturnedWith<d>(</><g>expected</><d>)</>

Expected: <g>"bar"</>
Received
5: <r>"foo5"</>
-> 6: <r>"foo6"</>

Number of returns: <r>6</>
`;

exports[`toHaveLastReturnedWith works only on spies or jest.fn 1`] = `
<d>expect(</><r>received</><d>).</>toHaveLastReturnedWith<d>(</><g>expected</><d>)</>

Expand Down Expand Up @@ -2720,6 +2766,29 @@ Expected: <g>"foo"</>
Number of returns: <r>0</>
`;

exports[`toHaveReturnedWith lastReturnedWith incomplete recursive calls are handled properly 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>toHaveReturnedWith<d>(</><g>expected</><d>)</>

Expected: <g>0</>
Received
1: function call has not returned yet
2: function call has not returned yet
3: function call has not returned yet

Number of returns: <r>0</>
Number of calls: <r>4</>
`;

exports[`toHaveReturnedWith lastReturnedWith works with three calls 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>not<d>.</>toHaveReturnedWith<d>(</><g>expected</><d>)</>

Expected: not <g>"foo3"</>
Received
3: <d>"foo3"</>

Number of returns: <r>3</>
`;

exports[`toHaveReturnedWith returnedWith incomplete recursive calls are handled properly 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>toHaveReturnedWith<d>(</><g>expected</><d>)</>

Expand Down Expand Up @@ -3145,6 +3214,29 @@ Expected: <g>"foo"</>
Number of returns: <r>0</>
`;

exports[`toReturnWith lastReturnedWith incomplete recursive calls are handled properly 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>toReturnWith<d>(</><g>expected</><d>)</>

Expected: <g>0</>
Received
1: function call has not returned yet
2: function call has not returned yet
3: function call has not returned yet

Number of returns: <r>0</>
Number of calls: <r>4</>
`;

exports[`toReturnWith lastReturnedWith works with three calls 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>not<d>.</>toReturnWith<d>(</><g>expected</><d>)</>

Expected: not <g>"foo3"</>
Received
3: <d>"foo3"</>

Number of returns: <r>3</>
`;

exports[`toReturnWith returnedWith incomplete recursive calls are handled properly 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>toReturnWith<d>(</><g>expected</><d>)</>

Expand Down
Expand Up @@ -7,7 +7,7 @@
*/

import fc from 'fast-check';
import expect from '..';
import expect from '../';
import {
anythingSettings,
assertSettings,
Expand Down
Expand Up @@ -7,7 +7,7 @@
*/

import fc from 'fast-check';
import expect from '..';
import expect from '../';
import {
anythingSettings,
assertSettings,
Expand Down
Expand Up @@ -7,7 +7,7 @@
*/

import fc from 'fast-check';
import expect from '..';
import expect from '../';
import {
anythingSettings,
assertSettings,
Expand Down
Expand Up @@ -8,7 +8,7 @@

import * as assert from 'assert';
import fc from 'fast-check';
import expect from '..';
import expect from '../';
import {
anythingSettings,
assertSettings,
Expand Down