Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
Prev Previous commit
concat warns
what we are really testing is ensure exsistance of a specific warn not whole warnings behavior
  • Loading branch information
pi0 committed Aug 22, 2022
commit 34cf53a80ed60377477976c9bd8ba23e4d332353
7 changes: 2 additions & 5 deletions test/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,8 @@ if (process.env.NUXT_TEST_DEV) {
it('should detect invalid root nodes in pages', async () => {
for (const path of ['1', '2', '3', '4']) {
const { consoleLogs } = await renderPage(joinURL('/invalid-root', path))

const consoleLogsWarns = consoleLogs.filter(i => i.type === 'warning')

expect(consoleLogsWarns.length).toEqual(1)
expect(consoleLogsWarns[0].text).toContain('does not have a single root node and will cause errors when navigating between routes')
const consoleLogsWarns = consoleLogs.filter(i => i.type === 'warning').map(w => w.text).join('\n')
expect(consoleLogsWarns).toContain('does not have a single root node and will cause errors when navigating between routes')
}
})

Expand Down