Skip to content

Commit

Permalink
support array in properties matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
bakamitai456 committed Jun 15, 2023
1 parent cbbec0a commit 77ae436
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,6 @@ exports[`matcher error toMatchNamedSnapshot received value must be an object (nu
Received has value: <r>null</>
`;

exports[`matcher error toMatchSnapshot Expected properties must be an object (array) 1`] = `
<d>expect(</><r>received</><d>).</>toMatchSnapshot<d>(</><g>properties</><d>)</>

<b>Matcher error</>: Expected <g>properties</> must be an object

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

exports[`matcher error toMatchSnapshot Expected properties must be an object (non-null) 1`] = `
<d>expect(</><r>received</><d>).</>toMatchSnapshot<d>(</><g>properties</><d>)</>

Expand Down
14 changes: 0 additions & 14 deletions packages/jest-snapshot/src/__tests__/printSnapshot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,20 +311,6 @@ describe('matcher error', () => {
}).toThrowErrorMatchingSnapshot();
});

test('Expected properties must be an object (array)', () => {
const context = {
isNot: false,
promise: '',
} as Context;
const properties: Array<unknown> = [];
const snapshotName =
'toMatchNamedSnapshot Expected properties must be an object (array)';

expect(() => {
toMatchNamedSnapshot.call(context, received, snapshotName, properties);
}).toThrowErrorMatchingSnapshot();
});

describe('received value must be an object', () => {
const context = {
currentTestName: '',
Expand Down

0 comments on commit 77ae436

Please sign in to comment.