From 71c96cfef7f704dff86b3d878476efb5d3cb04b4 Mon Sep 17 00:00:00 2001 From: Yusuf Kandemir Date: Tue, 9 May 2023 13:49:15 +0300 Subject: [PATCH] test(vite-plugin): Make sure console.warn is not called --- vite-plugin/test/cypress/script-transform.cy.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vite-plugin/test/cypress/script-transform.cy.ts b/vite-plugin/test/cypress/script-transform.cy.ts index cfe9d1de66e..52559dfc40e 100644 --- a/vite-plugin/test/cypress/script-transform.cy.ts +++ b/vite-plugin/test/cypress/script-transform.cy.ts @@ -14,7 +14,13 @@ const types = [ describe('Script Transform', () => { beforeEach(() => { - cy.visit('/') + cy.visit('/', { + onBeforeLoad (win) { + cy.spy(win.console, 'warn').as('consoleWarn') + } + }) + + cy.get('@consoleWarn').should('not.have.been.called') }) it('should transform