From 6a48986e2bb29123196940b347372fd23ad89dc2 Mon Sep 17 00:00:00 2001 From: hemengke1997 <23536175@qq.com> Date: Fri, 20 Oct 2023 09:35:03 +0800 Subject: [PATCH] wip: test ci --- playground/spa/__tests__/spa.spec.ts | 1 + playground/vitestSetup.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/playground/spa/__tests__/spa.spec.ts b/playground/spa/__tests__/spa.spec.ts index ecee8cc..88c13d6 100644 --- a/playground/spa/__tests__/spa.spec.ts +++ b/playground/spa/__tests__/spa.spec.ts @@ -30,6 +30,7 @@ describe('hmr', () => { () => editFile('public-typescript/hmr.ts', (code) => code.replace('hmr original text', u)), ['[vite] hot updated: /src/App.tsx'], false, + (l) => console.log(l, 'l'), ) await untilUpdated(() => page.textContent('#hmr'), u) }) diff --git a/playground/vitestSetup.ts b/playground/vitestSetup.ts index 5611d7f..c15c20e 100644 --- a/playground/vitestSetup.ts +++ b/playground/vitestSetup.ts @@ -112,7 +112,7 @@ beforeAll(async (s) => { } try { - page.addListener('console', (msg) => { + page.on('console', (msg) => { // ignore favicon request in headed browser if ( process.env.VITE_DEBUG_SERVE && @@ -121,6 +121,7 @@ beforeAll(async (s) => { ) { return } + if (msg.text().includes('React DevTools')) return browserLogs.push(msg.text()) }) page.on('pageerror', (error) => {