| 87 | |
| 88 | describe('isPatchyFaceAnimated', () => { |
| 89 | const load = ( |
| 90 | faces?: { face: string; image: string }[], |
| 91 | ): typeof PatchyConfigModule => { |
| 92 | localStorage.setItem('patchy_config', JSON.stringify({ faces })); |
| 93 | let loaded: typeof PatchyConfigModule | undefined; |
| 94 | jest.isolateModules(() => { |
| 95 | // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires |
| 96 | loaded = require('./patchyConfig'); |
| 97 | }); |
| 98 | if (!loaded) { |
| 99 | throw new Error('patchyConfig did not load'); |
| 100 | } |
| 101 | return loaded; |
| 102 | }; |
| 103 | |
| 104 | afterEach(() => localStorage.clear()); |
| 105 | |