All files / util/src/json-equal/deepEqual/__tests__ runDeepEqualTestSuite.ts

100% Statements 11/11
100% Branches 0/0
100% Functions 3/3
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 172x   2x 2x 10x 10x 86x 86x 86x 86x 86x            
import {tests} from './tests';
 
export const runDeepEqualTestSuite = (deepEqual: (a: unknown, b: unknown) => boolean) => {
  for (const s of tests) {
    describe(s.description, () => {
      for (const t of s.tests) {
        test(t.description, () => {
          const res1 = deepEqual(t.value1, t.value2);
          const res2 = deepEqual(t.value2, t.value1);
          expect(res1).toBe(t.equal);
          expect(res2).toBe(t.equal);
        });
      }
    });
  }
};