From 92ac9378d899e7f1c6cde01e2fcc0c3e66806c68 Mon Sep 17 00:00:00 2001 From: fi3ework Date: Wed, 9 Apr 2025 23:17:02 +0800 Subject: [PATCH] ci: ecosystem ci won't test snapshot --- package.json | 1 + tests/setupVitestTests.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/package.json b/package.json index 8e52cc230..0a8b78500 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "test": "pnpm run test:unit && pnpm run test:integration && pnpm run test:e2e", "test:benchmark": "cd ./tests && pnpm run test:benchmark", "test:e2e": "pnpm run build:examples && cd tests && pnpm run test:e2e", + "test:ecosystem-ci": "pnpm run test:unit && cross-env ECO_CI=1 pnpm run test:integration && pnpm run test:e2e", "test:integration": "cross-env NODE_OPTIONS='--experimental-vm-modules' vitest run --project integration", "test:integration:watch": "cross-env NODE_OPTIONS='--experimental-vm-modules' vitest --project integration", "test:unit": "vitest run --project unit*", diff --git a/tests/setupVitestTests.ts b/tests/setupVitestTests.ts index 84aebab70..b6d4bb4ab 100644 --- a/tests/setupVitestTests.ts +++ b/tests/setupVitestTests.ts @@ -18,3 +18,16 @@ expect.addSnapshotSerializer( }, }), ); + +if (process.env.ECO_CI) { + expect.extend({ + toMatchSnapshot: () => ({ + pass: true, + message: () => 'Snapshot always passes', + }), + toMatchInlineSnapshot: () => ({ + pass: true, + message: () => 'Snapshot always passes', + }), + }); +}