diff --git a/__tests__/integration/utils/filterTests.ts b/__tests__/integration/utils/filterTests.ts index b117ebb4e0..26cf0bfdd1 100644 --- a/__tests__/integration/utils/filterTests.ts +++ b/__tests__/integration/utils/filterTests.ts @@ -4,6 +4,9 @@ export function filterTests(test) { // @ts-ignore ([, { only = false }]) => only, ); + if (onlys.length !== 0 && process.env.CI === 'true') { + throw new Error('Please remove `test.only`.'); + } const runnables = onlys.length === 0 ? tests : onlys; return runnables.filter( // @ts-ignore diff --git a/__tests__/integration/utils/toMatchCanvasSnapshot.ts b/__tests__/integration/utils/toMatchCanvasSnapshot.ts index 10120dbcad..7a14b49d56 100644 --- a/__tests__/integration/utils/toMatchCanvasSnapshot.ts +++ b/__tests__/integration/utils/toMatchCanvasSnapshot.ts @@ -66,6 +66,9 @@ export async function toMatchCanvasSnapshot( try { if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true }); if (!fs.existsSync(expectedPath)) { + if (process.env.CI === 'true') { + throw new Error(`Please generate golden image for ${namePath}`); + } console.warn(`! generate ${namePath}`); await writePNG(canvas, expectedPath); return { diff --git a/__tests__/integration/utils/toMatchDOMSnapshot.ts b/__tests__/integration/utils/toMatchDOMSnapshot.ts index 700123354b..92294d3fb4 100644 --- a/__tests__/integration/utils/toMatchDOMSnapshot.ts +++ b/__tests__/integration/utils/toMatchDOMSnapshot.ts @@ -37,6 +37,9 @@ export async function toMatchDOMSnapshot( : 'null'; if (!fs.existsSync(expectedPath)) { + if (process.env.CI === 'true') { + throw new Error(`Please generate golden image for ${namePath}`); + } console.warn(`! generate ${namePath}`); await fs.writeFileSync(expectedPath, actual); return {