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

Remove aliased matchers #13192

Closed
Prev Previous commit
Next Next commit
chore: remove .toReturnTimes() matcher
  • Loading branch information
EduardoSCosta committed Aug 30, 2022
commit 7fc2ec97fef036e645fc66915f30de69348de7e3
174 changes: 0 additions & 174 deletions packages/expect/src/__tests__/__snapshots__/spyMatchers.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2034,180 +2034,6 @@ Expected: not <g>undefined</>
Number of returns: <r>1</>
`;

exports[`toReturnTimes .not only accepts a number argument 1`] = `
<d>expect(</><r>received</><d>).</>not<d>.</>toReturnTimes<d>(</><g>expected</><d>)</>

<b>Matcher error</>: <g>expected</> value must be a non-negative integer

Expected has type: object
Expected has value: <g>{}</>
`;

exports[`toReturnTimes .not only accepts a number argument 2`] = `
<d>expect(</><r>received</><d>).</>not<d>.</>toReturnTimes<d>(</><g>expected</><d>)</>

<b>Matcher error</>: <g>expected</> value must be a non-negative integer

Expected has type: array
Expected has value: <g>[]</>
`;

exports[`toReturnTimes .not only accepts a number argument 3`] = `
<d>expect(</><r>received</><d>).</>not<d>.</>toReturnTimes<d>(</><g>expected</><d>)</>

<b>Matcher error</>: <g>expected</> value must be a non-negative integer

Expected has type: boolean
Expected has value: <g>true</>
`;

exports[`toReturnTimes .not only accepts a number argument 4`] = `
<d>expect(</><r>received</><d>).</>not<d>.</>toReturnTimes<d>(</><g>expected</><d>)</>

<b>Matcher error</>: <g>expected</> value must be a non-negative integer

Expected has type: string
Expected has value: <g>"a"</>
`;

exports[`toReturnTimes .not only accepts a number argument 5`] = `
<d>expect(</><r>received</><d>).</>not<d>.</>toReturnTimes<d>(</><g>expected</><d>)</>

<b>Matcher error</>: <g>expected</> value must be a non-negative integer

Expected has type: map
Expected has value: <g>Map {}</>
`;

exports[`toReturnTimes .not only accepts a number argument 6`] = `
<d>expect(</><r>received</><d>).</>not<d>.</>toReturnTimes<d>(</><g>expected</><d>)</>

<b>Matcher error</>: <g>expected</> value must be a non-negative integer

Expected has type: function
Expected has value: <g>[Function anonymous]</>
`;

exports[`toReturnTimes .not passes if function called less than expected times 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>toReturnTimes<d>(</><g>expected</><d>)</>

Expected number of returns: <g>2</>
Received number of returns: <r>1</>
`;

exports[`toReturnTimes .not passes if function returned more than expected times 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>toReturnTimes<d>(</><g>expected</><d>)</>

Expected number of returns: <g>2</>
Received number of returns: <r>3</>
`;

exports[`toReturnTimes calls that return undefined are counted as returns 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>not<d>.</>toReturnTimes<d>(</><g>expected</><d>)</>

Expected number of returns: not <g>2</>
`;

exports[`toReturnTimes calls that throw are not counted 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>toReturnTimes<d>(</><g>expected</><d>)</>

Expected number of returns: <g>3</>
Received number of returns: <r>2</>
Received number of calls: <r>3</>
`;

exports[`toReturnTimes calls that throw undefined are not counted 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>not<d>.</>toReturnTimes<d>(</><g>expected</><d>)</>

Expected number of returns: not <g>2</>

Received number of calls: <r>3</>
`;

exports[`toReturnTimes includes the custom mock name in the error message 1`] = `
<d>expect(</><r>named-mock</><d>).</>toReturnTimes<d>(</><g>expected</><d>)</>

Expected number of returns: <g>1</>
Received number of returns: <r>2</>
`;

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

Expected number of returns: not <g>2</>

Received number of calls: <r>4</>
`;

exports[`toReturnTimes only accepts a number argument 1`] = `
<d>expect(</><r>received</><d>).</>toReturnTimes<d>(</><g>expected</><d>)</>

<b>Matcher error</>: <g>expected</> value must be a non-negative integer

Expected has type: object
Expected has value: <g>{}</>
`;

exports[`toReturnTimes only accepts a number argument 2`] = `
<d>expect(</><r>received</><d>).</>toReturnTimes<d>(</><g>expected</><d>)</>

<b>Matcher error</>: <g>expected</> value must be a non-negative integer

Expected has type: array
Expected has value: <g>[]</>
`;

exports[`toReturnTimes only accepts a number argument 3`] = `
<d>expect(</><r>received</><d>).</>toReturnTimes<d>(</><g>expected</><d>)</>

<b>Matcher error</>: <g>expected</> value must be a non-negative integer

Expected has type: boolean
Expected has value: <g>true</>
`;

exports[`toReturnTimes only accepts a number argument 4`] = `
<d>expect(</><r>received</><d>).</>toReturnTimes<d>(</><g>expected</><d>)</>

<b>Matcher error</>: <g>expected</> value must be a non-negative integer

Expected has type: string
Expected has value: <g>"a"</>
`;

exports[`toReturnTimes only accepts a number argument 5`] = `
<d>expect(</><r>received</><d>).</>toReturnTimes<d>(</><g>expected</><d>)</>

<b>Matcher error</>: <g>expected</> value must be a non-negative integer

Expected has type: map
Expected has value: <g>Map {}</>
`;

exports[`toReturnTimes only accepts a number argument 6`] = `
<d>expect(</><r>received</><d>).</>toReturnTimes<d>(</><g>expected</><d>)</>

<b>Matcher error</>: <g>expected</> value must be a non-negative integer

Expected has type: function
Expected has value: <g>[Function anonymous]</>
`;

exports[`toReturnTimes passes if function returned equal to expected times 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>not<d>.</>toReturnTimes<d>(</><g>expected</><d>)</>

Expected number of returns: not <g>2</>
`;

exports[`toReturnTimes throw matcher error if received is spy 1`] = `
<d>expect(</><r>received</><d>).</>not<d>.</>toReturnTimes<d>(</><g>expected</><d>)</>

<b>Matcher error</>: <r>received</> value must be a mock function

Received has type: function
Received has value: <r>[Function spy]</>
`;

exports[`toReturnWith a call that throws is not considered to have returned 1`] = `
<d>expect(</><r>jest.fn()</><d>).</>toReturnWith<d>(</><g>expected</><d>)</>

Expand Down
Loading