MCPcopy
hub / github.com/jestjs/jest / testToMatchSnapshots

Function testToMatchSnapshots

packages/expect/src/__tests__/matchers.test.js:2147–2158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2145 };
2146
2147 const testToMatchSnapshots = tuples => {
2148 for (const [n1, n2] of tuples) {
2149 it(`{pass: false} expect(${stringify(n1)}).toMatchObject(${stringify(
2150 n2,
2151 )})`, () => {
2152 jestExpect(n1).not.toMatchObject(n2);
2153 expect(() =>
2154 jestExpect(n1).toMatchObject(n2),
2155 ).toThrowErrorMatchingSnapshot();
2156 });
2157 }
2158 };
2159
2160 describe('circular references', () => {
2161 describe('simple circular references', () => {

Callers 1

matchers.test.jsFile · 0.85

Calls 5

stringifyFunction · 0.85
expectFunction · 0.85
toMatchObjectMethod · 0.80
itFunction · 0.50

Tested by

no test coverage detected