mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-06 21:10:38 +00:00
misc: remove obsolete log spy
This commit is contained in:
parent
e9a810a253
commit
468881abda
@ -31,12 +31,9 @@ describe('basic dev', () => {
|
|||||||
// })
|
// })
|
||||||
|
|
||||||
test('/stateless', async () => {
|
test('/stateless', async () => {
|
||||||
// const spies = await intercept()
|
|
||||||
const window = await nuxt.renderAndGetWindow(url('/stateless'))
|
const window = await nuxt.renderAndGetWindow(url('/stateless'))
|
||||||
const html = window.document.body.innerHTML
|
const html = window.document.body.innerHTML
|
||||||
expect(html.includes('<h1>My component!</h1>')).toBe(true)
|
expect(html.includes('<h1>My component!</h1>')).toBe(true)
|
||||||
// expect(spies.info.calledWithMatch('You are running Vue in development mode.')).toBe(true)
|
|
||||||
// release()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// test('/_nuxt/test.hot-update.json should returns empty html', async t => {
|
// test('/_nuxt/test.hot-update.json should returns empty html', async t => {
|
||||||
@ -73,7 +70,6 @@ describe('basic dev', () => {
|
|||||||
const sourceMaps = nuxt.renderer.resources.serverBundle.maps
|
const sourceMaps = nuxt.renderer.resources.serverBundle.maps
|
||||||
nuxt.renderer.resources.serverBundle.maps = {}
|
nuxt.renderer.resources.serverBundle.maps = {}
|
||||||
|
|
||||||
// const errorSpy = await interceptError()
|
|
||||||
await expect(nuxt.renderAndGetWindow(url('/error'))).rejects.toMatchObject({
|
await expect(nuxt.renderAndGetWindow(url('/error'))).rejects.toMatchObject({
|
||||||
statusCode: 500
|
statusCode: 500
|
||||||
})
|
})
|
||||||
|
@ -28,7 +28,6 @@ describe('error', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('/ with renderAndGetWindow()', async () => {
|
test('/ with renderAndGetWindow()', async () => {
|
||||||
// const errorSpy = await interceptError()
|
|
||||||
await expect(nuxt.renderAndGetWindow(url('/'))).rejects.toMatchObject({
|
await expect(nuxt.renderAndGetWindow(url('/'))).rejects.toMatchObject({
|
||||||
statusCode: 500
|
statusCode: 500
|
||||||
})
|
})
|
||||||
|
@ -14,12 +14,8 @@ describe('with-config', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('/', async () => {
|
test('/', async () => {
|
||||||
// const logSpy = await interceptLog()
|
|
||||||
const { html } = await nuxt.renderRoute('/')
|
const { html } = await nuxt.renderRoute('/')
|
||||||
expect(html.includes('<h1>I have custom configurations</h1>')).toBe(true)
|
expect(html.includes('<h1>I have custom configurations</h1>')).toBe(true)
|
||||||
// release()
|
|
||||||
// expect(logSpy.calledOnce).toBe(true)
|
|
||||||
// expect(logSpy.args[0][0]).toBe('Test plugin!')
|
|
||||||
})
|
})
|
||||||
|
|
||||||
test.skip('/ (global styles inlined)', async () => {
|
test.skip('/ (global styles inlined)', async () => {
|
||||||
@ -61,12 +57,7 @@ describe('with-config', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('/test/about (custom layout)', async () => {
|
test('/test/about (custom layout)', async () => {
|
||||||
// const logSpy = await interceptLog()
|
|
||||||
const window = await nuxt.renderAndGetWindow(url('/test/about'))
|
const window = await nuxt.renderAndGetWindow(url('/test/about'))
|
||||||
// expect(logSpy.calledOnce).toBe(true)
|
|
||||||
// expect(logSpy.args[0][0]).toBe('Test plugin!')
|
|
||||||
// release()
|
|
||||||
|
|
||||||
const html = window.document.body.innerHTML
|
const html = window.document.body.innerHTML
|
||||||
expect(window.__NUXT__.layout).toBe('custom')
|
expect(window.__NUXT__.layout).toBe('custom')
|
||||||
expect(html.includes('<h1>Custom layout</h1>')).toBe(true)
|
expect(html.includes('<h1>Custom layout</h1>')).toBe(true)
|
||||||
@ -74,12 +65,7 @@ describe('with-config', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('/test/desktop (custom layout in desktop folder)', async () => {
|
test('/test/desktop (custom layout in desktop folder)', async () => {
|
||||||
// const logSpy = await interceptLog()
|
|
||||||
const window = await nuxt.renderAndGetWindow(url('/test/desktop'))
|
const window = await nuxt.renderAndGetWindow(url('/test/desktop'))
|
||||||
// expect(logSpy.calledOnce).toBe(true)
|
|
||||||
// expect(logSpy.args[0][0]).toBe('Test plugin!')
|
|
||||||
// release()
|
|
||||||
|
|
||||||
const html = window.document.body.innerHTML
|
const html = window.document.body.innerHTML
|
||||||
expect(window.__NUXT__.layout).toBe('desktop/default')
|
expect(window.__NUXT__.layout).toBe('desktop/default')
|
||||||
expect(html.includes('<h1>Default desktop layout</h1>')).toBe(true)
|
expect(html.includes('<h1>Default desktop layout</h1>')).toBe(true)
|
||||||
@ -87,12 +73,7 @@ describe('with-config', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('/test/mobile (custom layout in mobile folder)', async () => {
|
test('/test/mobile (custom layout in mobile folder)', async () => {
|
||||||
// const logSpy = await interceptLog()
|
|
||||||
const window = await nuxt.renderAndGetWindow(url('/test/mobile'))
|
const window = await nuxt.renderAndGetWindow(url('/test/mobile'))
|
||||||
// expect(logSpy.calledOnce).toBe(true)
|
|
||||||
// expect(logSpy.args[0][0]).toBe('Test plugin!')
|
|
||||||
// release()
|
|
||||||
|
|
||||||
const html = window.document.body.innerHTML
|
const html = window.document.body.innerHTML
|
||||||
expect(window.__NUXT__.layout).toBe('mobile/default')
|
expect(window.__NUXT__.layout).toBe('mobile/default')
|
||||||
expect(html.includes('<h1>Default mobile layout</h1>')).toBe(true)
|
expect(html.includes('<h1>Default mobile layout</h1>')).toBe(true)
|
||||||
@ -100,12 +81,7 @@ describe('with-config', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('/test/env', async () => {
|
test('/test/env', async () => {
|
||||||
// const logSpy = await interceptLog()
|
|
||||||
const window = await nuxt.renderAndGetWindow(url('/test/env'))
|
const window = await nuxt.renderAndGetWindow(url('/test/env'))
|
||||||
// expect(logSpy.calledOnce).toBe(true)
|
|
||||||
// expect(logSpy.args[0][0]).toBe('Test plugin!')
|
|
||||||
// release()
|
|
||||||
|
|
||||||
const html = window.document.body.innerHTML
|
const html = window.document.body.innerHTML
|
||||||
expect(html.includes('<h1>Custom env layout</h1>')).toBe(true)
|
expect(html.includes('<h1>Custom env layout</h1>')).toBe(true)
|
||||||
expect(html.includes('"bool": true')).toBe(true)
|
expect(html.includes('"bool": true')).toBe(true)
|
||||||
@ -118,46 +94,26 @@ describe('with-config', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('/test/error', async () => {
|
test('/test/error', async () => {
|
||||||
// const logSpy = await interceptLog()
|
|
||||||
const window = await nuxt.renderAndGetWindow(url('/test/error'))
|
const window = await nuxt.renderAndGetWindow(url('/test/error'))
|
||||||
// expect(logSpy.calledOnce).toBe(true)
|
|
||||||
// expect(logSpy.args[0][0]).toBe('Test plugin!')
|
|
||||||
// release()
|
|
||||||
|
|
||||||
const html = window.document.body.innerHTML
|
const html = window.document.body.innerHTML
|
||||||
expect(html.includes('Error page')).toBe(true)
|
expect(html.includes('Error page')).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('/test/user-agent', async () => {
|
test('/test/user-agent', async () => {
|
||||||
// const logSpy = await interceptLog()
|
|
||||||
const window = await nuxt.renderAndGetWindow(url('/test/user-agent'))
|
const window = await nuxt.renderAndGetWindow(url('/test/user-agent'))
|
||||||
// expect(logSpy.calledOnce).toBe(true)
|
|
||||||
// expect(logSpy.args[0][0]).toBe('Test plugin!')
|
|
||||||
// release()
|
|
||||||
|
|
||||||
const html = window.document.body.innerHTML
|
const html = window.document.body.innerHTML
|
||||||
expect(html.includes('<pre>Mozilla')).toBe(true)
|
expect(html.includes('<pre>Mozilla')).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('/test/about-bis (added with extendRoutes)', async () => {
|
test('/test/about-bis (added with extendRoutes)', async () => {
|
||||||
// const logSpy = await interceptLog()
|
|
||||||
const window = await nuxt.renderAndGetWindow(url('/test/about-bis'))
|
const window = await nuxt.renderAndGetWindow(url('/test/about-bis'))
|
||||||
// expect(logSpy.calledOnce).toBe(true)
|
|
||||||
// expect(logSpy.args[0][0]).toBe('Test plugin!')
|
|
||||||
// release()
|
|
||||||
|
|
||||||
const html = window.document.body.innerHTML
|
const html = window.document.body.innerHTML
|
||||||
expect(html.includes('<h1>Custom layout</h1>')).toBe(true)
|
expect(html.includes('<h1>Custom layout</h1>')).toBe(true)
|
||||||
expect(html.includes('<h1>About page</h1>')).toBe(true)
|
expect(html.includes('<h1>About page</h1>')).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('/test/redirect/about-bis (redirect with extendRoutes)', async () => {
|
test('/test/redirect/about-bis (redirect with extendRoutes)', async () => {
|
||||||
// const logSpy = await interceptLog()
|
|
||||||
const window = await nuxt.renderAndGetWindow(url('/test/redirect/about-bis'))
|
const window = await nuxt.renderAndGetWindow(url('/test/redirect/about-bis'))
|
||||||
// expect(logSpy.calledOnce).toBe(true)
|
|
||||||
// expect(logSpy.args[0][0]).toBe('Test plugin!')
|
|
||||||
// release()
|
|
||||||
|
|
||||||
const windowHref = window.location.href
|
const windowHref = window.location.href
|
||||||
expect(windowHref.includes('/test/about-bis')).toBe(true)
|
expect(windowHref.includes('/test/about-bis')).toBe(true)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user