| Total Complexity | 1 |
| Complexity/F | 0 |
| Lines of Code | 20 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /** |
||
| 2 | * Setup to run before any tests that require react-intl |
||
| 3 | * support, see https://testing-library.com/docs/example-react-intl#configuring-react-intl-polyfills |
||
| 4 | */ |
||
| 5 | import IntlPolyfill from "intl"; |
||
| 6 | import "intl/locale-data/jsonp/en"; |
||
| 7 | import "intl/locale-data/jsonp/fr"; |
||
| 8 | |||
| 9 | const setupTests = (): void => { |
||
| 10 | // https://formatjs.io/guides/runtime-environments/#server |
||
| 11 | if (global.Intl) { |
||
| 12 | Intl.NumberFormat = IntlPolyfill.NumberFormat; |
||
| 13 | Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat; |
||
| 14 | } else { |
||
| 15 | global.Intl = IntlPolyfill; |
||
| 16 | } |
||
| 17 | }; |
||
| 18 | |||
| 19 | setupTests(); |
||
| 20 |