Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Remove toBeArrayOfUniqueItems custom matcher
Browse files Browse the repository at this point in the history
It is only ever used to assert that an array returned by Object.keys is
unique, and that's always going to be true as an object can't have two
keys with the same name.
  • Loading branch information
BPScott committed Sep 18, 2024
1 parent 979fa8b commit a863e85
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 64 deletions.
3 changes: 0 additions & 3 deletions packages/react-i18n/src/tests/e2e/server.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* @jest-environment node
*/

import '../matchers';

import React from 'react';
import {renderToStaticMarkup} from 'react-dom/server';
import {extract, Effect} from '@shopify/react-effect/server';
Expand Down Expand Up @@ -105,7 +103,6 @@ describe('server', () => {
const translations = manager.extract();

const extractedTranslations = Object.values(translations);
expect(Object.keys(translations)).toBeArrayOfUniqueItems();
expect(extractedTranslations).toContain(frCATranslations);
expect(extractedTranslations).toContain(frTranslations);
});
Expand Down
2 changes: 0 additions & 2 deletions packages/react-i18n/src/tests/i18n.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {clock} from '@shopify/jest-dom-mocks';

import './matchers';

import {I18n} from '../i18n';
import {LanguageDirection} from '../types';
import {DateStyle, Weekday} from '../constants';
Expand Down
4 changes: 0 additions & 4 deletions packages/react-i18n/src/tests/manager.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import './matchers';

import {animationFrame} from '@shopify/jest-dom-mocks';

import {I18nManager} from '../manager';
Expand Down Expand Up @@ -447,8 +445,6 @@ describe('I18nManager', () => {
await manager.resolve();

const translationsByID = manager.extract();
expect(Object.keys(translationsByID)).toBeArrayOfUniqueItems();

const translations = Object.values(translationsByID);
expect(translations).toContain(enUS);
expect(translations).toContain(en);
Expand Down
27 changes: 0 additions & 27 deletions packages/react-i18n/src/tests/matchers.ts

This file was deleted.

27 changes: 0 additions & 27 deletions tests/matchers/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion tests/setup/tests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import '../matchers';
import '../../packages/react-testing/src/matchers';
import '../../packages/graphql-testing/src/matchers';

Expand Down

0 comments on commit a863e85

Please sign in to comment.