Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
bakamitai456 committed Jun 15, 2023
1 parent c5fe519 commit 35bbdeb
Show file tree
Hide file tree
Showing 2 changed files with 460 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`change text value 1`] = `
<d>expect(</><t>received</><d>).</>toMatchSnapshot<d>(</>properties<d>, </><b>hint</><d>)</>

Snapshot name: \`with properties: <b>change text value</> 1\`

<m>- Snapshot - 1</>
<t>+ Received + 1</>

<d> Object {</>
<d> "id": "abcdef",</>
<m>- "text": "snapshot",</>
<t>+ "text": "received",</>
<d> "type": "ADD_ITEM",</>
<d> }</>
`;

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

Expand Down Expand Up @@ -32,6 +48,67 @@ exports[`matcher error toMatchInlineSnapshot Snapshot matchers cannot be used wi
<b>Matcher error</>: Snapshot matchers cannot be used with <b>not</>
`;

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

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

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

exports[`matcher error toMatchNamedSnapshot Expected properties must be an object (null) with snapshot name 1`] = `
<d>expect(</><r>received</><d>).</>toMatchNamedSnapshot<d>(</><g>properties</><d>, </><b>snapshotName</><d>)</>

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

Expected properties has value: <g>null</>

To provide a snapshot name without properties: toMatchNamedSnapshot('snapshotName')
`;

exports[`matcher error toMatchNamedSnapshot Expected properties must be an object (null) without snapshot name 1`] = `
<d>expect(</><r>received</><d>).</>toMatchNamedSnapshot<d>(</><g>properties</><d>)</>

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

Expected properties has value: <g>null</>
`;

exports[`matcher error toMatchNamedSnapshot Snapshot state must be initialized 1`] = `
<d>expect(</><r>received</><d>).</>resolves<d>.</>toMatchNamedSnapshot<d>()</>

Snapshot state must be initialized

Snapshot state has value: undefined
`;

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

<b>Matcher error</>: <r>received</> value must be an object when the matcher has <g>properties</>

Received has type: string
Received has value: <r>"string"</>
`;

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

<b>Matcher error</>: <r>received</> value must be an object when the matcher has <g>properties</>

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 Expand Up @@ -166,6 +243,32 @@ Snapshot name: \`with properties 1\`
<d> }</>
`;

exports[`pass false toMatchNamedSnapshot empty snapshot name New snapshot was not written (multi line) 1`] = `
<d>expect(</><t>received</><d>).</>toMatchNamedSnapshot<d>()</>

Snapshot name: \`New snapshot was not written 1\`

New snapshot was <b>not written</>. The update flag must be explicitly passed to write a new snapshot.

This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default.

Received:
<t>"To write or not to write,</>
<t>that is the question."</>
`;

exports[`pass false toMatchNamedSnapshot empty snapshot name New snapshot was not written (single line) 1`] = `
<d>expect(</><t>received</><d>).</>toMatchNamedSnapshot<d>()</>

Snapshot name: \`New snapshot was not written 2\`

New snapshot was <b>not written</>. The update flag must be explicitly passed to write a new snapshot.

This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default.

Received: <t>"Write me if you can!"</>
`;

exports[`pass false toMatchSnapshot New snapshot was not written (multi line) 1`] = `
<d>expect(</><t>received</><d>).</>toMatchSnapshot<d>(</><b>hint</><d>)</>

Expand Down Expand Up @@ -638,3 +741,52 @@ exports[`printSnapshotAndReceived without serialize prettier/pull/5590 1`] = `

<d> ================================================================================</>
`;

exports[`specific-line-diff-false 1`] = `
<d>expect(</><r>received</><d>).</>toMatchNamedSnapshot<d>(</><g>properties</><d>)</>

Snapshot name: \`with properties 1\`

Expected properties: <g>{"name": "Error"}</>
Received value: <r>[RangeError: Invalid array length]</>
`;

exports[`specific-line-diff-true 1`] = `
<d>expect(</><r>received</><d>).</>toMatchNamedSnapshot<d>(</><g>properties</><d>)</>

Snapshot name: \`with properties 1\`

<g>- Expected properties - 1</>
<r>+ Received value + 1</>

<d> Object {</>
<g>- "id": "abcdef",</>
<r>+ "id": "abcdefg",</>
<d> }</>
`;

exports[`specific-not-written-multi-line 1`] = `
<d>expect(</><t>received</><d>).</>toMatchNamedSnapshot<d>()</>

Snapshot name: \`New snapshot was not written 1\`

New snapshot was <b>not written</>. The update flag must be explicitly passed to write a new snapshot.

This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default.

Received:
<t>"To write or not to write,</>
<t>that is the question."</>
`;

exports[`specific-not-written-single-line 1`] = `
<d>expect(</><t>received</><d>).</>toMatchNamedSnapshot<d>()</>

Snapshot name: \`New snapshot was not written 2\`

New snapshot was <b>not written</>. The update flag must be explicitly passed to write a new snapshot.

This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default.

Received: <t>"Write me if you can!"</>
`;
Loading

0 comments on commit 35bbdeb

Please sign in to comment.