fix(ssr-testing): fix code (#7466)

This commit is contained in:
三咲智子 2022-05-02 15:15:22 +08:00 committed by GitHub
parent 84c0b6a37f
commit 120405aa72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View File

@ -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",

View File

@ -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)
})

View File

@ -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
}
}