()
| 1 | import fontsourceMetadata from './fixtures/fontsource.json'; |
| 2 | |
| 3 | export const mockMetadata = () => { |
| 4 | const fetchMock = getMiniflareFetchMock(); |
| 5 | // Throw when no matching mocked request is found |
| 6 | fetchMock.disableNetConnect(); |
| 7 | |
| 8 | // Handlers |
| 9 | // We want this to be the default response for all requests |
| 10 | const origin = fetchMock.get('https://raw.githubusercontent.com'); |
| 11 | origin |
| 12 | .intercept({ |
| 13 | method: 'GET', |
| 14 | path: '/fontsource/font-files/main/metadata/fontsource.json', |
| 15 | }) |
| 16 | .reply(200, JSON.stringify(fontsourceMetadata)); |
| 17 | }; |
no test coverage detected