diff --git a/package.json b/package.json index e87bf8e..e5c1544 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "lint:fix": "eslint --fix", "start": "node dist/index.js", "test": "jest", + "test:update-fixtures": "TEST_UPDATE_FIXTURES=1 npm run test", "ci": "npm run lint && npm run analyse && npm run test" }, "repository": { diff --git a/src/utils/__mocks__/Fetcher.ts b/src/utils/__mocks__/Fetcher.ts index 4fb0545..dd9203a 100644 --- a/src/utils/__mocks__/Fetcher.ts +++ b/src/utils/__mocks__/Fetcher.ts @@ -34,7 +34,12 @@ export class Fetcher { let response; try { - response = await callable(); + if (process.env['TEST_UPDATE_FIXTURES']) { + response = await callable(); + } else { + console.error(`No fixture found at "${path}".`); + process.exit(1); + } } catch (error) { if (error instanceof AxiosError) { const fixtureError = JSON.stringify({