diff --git a/package.json b/package.json index c1d6b58c8f..6a846d3410 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "cz": "git-cz", "test": "vitest", "test:coverage": "vitest --coverage", - "test:ssr": "rimraf ./ssr-testing/screenshots/* && vitest --config ./ssr-testing/vitest.config.ts", + "test:ssr": "vitest --config ./ssr-testing/vitest.config.ts", "prepare:e2e": "if [ ! -d \"docs/.vitepress/dist\" ]; then pnpm run docs:build; fi;", "dev": "pnpm -C play dev", "gen": "bash ./scripts/gc.sh", diff --git a/ssr-testing/demo.spec.puppeteer.tsx b/ssr-testing/demo.spec.puppeteer.tsx index 0e3d2d2339..05cbac637a 100644 --- a/ssr-testing/demo.spec.puppeteer.tsx +++ b/ssr-testing/demo.spec.puppeteer.tsx @@ -1,7 +1,7 @@ import path from 'path' import { createApp } from 'vue' import { renderToString } from '@vue/server-renderer' -import { beforeAll, describe, expect, it } from 'vitest' +import { afterAll, beforeAll, describe, expect, it } from 'vitest' import puppeteer from 'puppeteer' import glob from 'fast-glob' import ElementPlus, { ID_INJECTION_KEY } from '../dist/element-plus' @@ -17,6 +17,10 @@ describe('Cypress Button', () => { browser = await puppeteer.launch() }) + afterAll(() => { + browser.close() + }) + describe('when initialized', () => { const demoPaths = glob .sync(`${demoRoot}/*.vue`) @@ -58,6 +62,7 @@ describe('Cypress Button', () => { // path: path.join(testRoot, 'screenshots', screenshotPath), // fullPage: true, // }) + await page.close() expect(true).toBe(true) }) diff --git a/ssr-testing/tsconfig.json b/ssr-testing/tsconfig.json index 2c0768a14f..5cc86ac744 100644 --- a/ssr-testing/tsconfig.json +++ b/ssr-testing/tsconfig.json @@ -1,11 +1,12 @@ { "extends": "@vue/tsconfig/tsconfig.node.json", - "include": ["../packages/components/**/ssr/*.vue"], + "include": ["../packages/components/**/ssr/*.vue", "**/*"], "compilerOptions": { "isolatedModules": false, "module": "ESNext", "target": "ES5", "lib": ["ES5", "DOM"], - "jsx": "preserve" + "jsx": "preserve", + "esModuleInterop": true } }