Skip to content

chore: refactor test setup #442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions playground/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ export default defineConfig({
testTimeout: timeout,
hookTimeout: timeout,
reporters: 'dot',
onConsoleLog(log) {
if (log.match(/experimental|jit engine|emitted file|tailwind/i))
return false
},
},
esbuild: {
target: 'node14',
Expand Down
15 changes: 1 addition & 14 deletions playground/vitestSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ export const serverLogs: string[] = []
export const browserLogs: string[] = []
export const browserErrors: Error[] = []

export let resolvedConfig: ResolvedConfig = undefined!

export let page: Page = undefined!
export let browser: Browser = undefined!
export let viteTestUrl: string = ''
Expand Down Expand Up @@ -104,15 +102,6 @@ beforeAll(async (s) => {
browser = await chromium.connect(wsEndpoint)
page = await browser.newPage()

const globalConsole = global.console
const warn = globalConsole.warn
globalConsole.warn = (msg, ...args) => {
// suppress @vue/reactivity-transform warning
if (msg.includes('@vue/reactivity-transform')) return
if (msg.includes('Generated an empty chunk')) return
warn.call(globalConsole, msg, ...args)
}

try {
page.on('console', (msg) => {
// ignore favicon request in headed browser
Expand Down Expand Up @@ -223,9 +212,6 @@ async function loadConfig(configEnv: ConfigEnv) {
usePolling: true,
interval: 100,
},
fs: {
strict: !isBuild,
},
},
build: {
// esbuild do not minify ES lib output since that would remove pure annotations and break tree-shaking
Expand Down Expand Up @@ -253,6 +239,7 @@ export async function startDefaultServe(): Promise<void> {
await page.goto(viteTestUrl)
} else {
process.env.VITE_INLINE = 'inline-build'
let resolvedConfig: ResolvedConfig
// determine build watch
const resolvedPlugin: () => PluginOption = () => ({
name: 'vite-plugin-watcher',
Expand Down
Loading