From 1e1cb00a148ef14e83abcd0ec7f9897c33be3899 Mon Sep 17 00:00:00 2001 From: hustcc Date: Tue, 3 Dec 2024 15:13:52 +0800 Subject: [PATCH] chore: test --- __tests__/integration/utils/toMatchDOMSnapshot.ts | 6 ++++-- package.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/__tests__/integration/utils/toMatchDOMSnapshot.ts b/__tests__/integration/utils/toMatchDOMSnapshot.ts index cdc0f45193..2f1b931d28 100644 --- a/__tests__/integration/utils/toMatchDOMSnapshot.ts +++ b/__tests__/integration/utils/toMatchDOMSnapshot.ts @@ -39,7 +39,7 @@ export async function toMatchDOMSnapshot( name: string, options: ToMatchDOMSnapshotOptions = {}, ): Promise<{ message: () => string; pass: boolean }> { - const { selector, fileFormat = 'svg', keepSVGElementId = true } = options; + const { selector, fileFormat = 'svg', keepSVGElementId = false } = options; const namePath = path.join(dir, name); const actualPath = path.join(dir, `${name}-actual.${fileFormat}`); const expectedPath = path.join(dir, `${name}.${fileFormat}`); @@ -74,7 +74,9 @@ export async function toMatchDOMSnapshot( encoding: 'utf8', flag: 'r', }); - if (isSVGEqual(actual, expected)) { + console.log(11111, actual); + // console.log(11111, expected); + if (isSVGEqual(actual, expected, keepSVGElementId)) { if (fs.existsSync(actualPath)) fs.unlinkSync(actualPath); return { message: () => `match ${namePath}`, diff --git a/package.json b/package.json index fa605614a7..c16e17fccd 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "size": "limit-size", "lint": "eslint ./src ./__tests__ && prettier ./src ./__tests__ --check ", "fix": "eslint ./src ./__tests__ --fix && prettier ./src ./__tests__ --write ", - "test": "cross-env TZ=Asia/Shanghai jest __tests__", + "test": "cross-env TZ=Asia/Shanghai jest __tests__/integration/api-chart-emit-item-tooltip.spec.ts", "test:unit": "cross-env TZ=Asia/Shanghai jest __tests__/unit/", "test:integration": "cross-env TZ=Asia/Shanghai jest __tests__/integration/", "preview": "vite preview",