misc: remove obsolete log spy

This commit is contained in:
Clark Du 2018-04-19 00:06:22 +08:00
parent e9a810a253
commit 468881abda
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9
3 changed files with 0 additions and 49 deletions

View File

@ -31,12 +31,9 @@ describe('basic dev', () => {
// })
test('/stateless', async () => {
// const spies = await intercept()
const window = await nuxt.renderAndGetWindow(url('/stateless'))
const html = window.document.body.innerHTML
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 => {
@ -73,7 +70,6 @@ describe('basic dev', () => {
const sourceMaps = nuxt.renderer.resources.serverBundle.maps
nuxt.renderer.resources.serverBundle.maps = {}
// const errorSpy = await interceptError()
await expect(nuxt.renderAndGetWindow(url('/error'))).rejects.toMatchObject({
statusCode: 500
})

View File

@ -28,7 +28,6 @@ describe('error', () => {
})
test('/ with renderAndGetWindow()', async () => {
// const errorSpy = await interceptError()
await expect(nuxt.renderAndGetWindow(url('/'))).rejects.toMatchObject({
statusCode: 500
})

View File

@ -14,12 +14,8 @@ describe('with-config', () => {
})
test('/', async () => {
// const logSpy = await interceptLog()
const { html } = await nuxt.renderRoute('/')
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 () => {
@ -61,12 +57,7 @@ describe('with-config', () => {
})
test('/test/about (custom layout)', async () => {
// const logSpy = await interceptLog()
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
expect(window.__NUXT__.layout).toBe('custom')
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 () => {
// const logSpy = await interceptLog()
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
expect(window.__NUXT__.layout).toBe('desktop/default')
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 () => {
// const logSpy = await interceptLog()
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
expect(window.__NUXT__.layout).toBe('mobile/default')
expect(html.includes('<h1>Default mobile layout</h1>')).toBe(true)
@ -100,12 +81,7 @@ describe('with-config', () => {
})
test('/test/env', async () => {
// const logSpy = await interceptLog()
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
expect(html.includes('<h1>Custom env layout</h1>')).toBe(true)
expect(html.includes('"bool": true')).toBe(true)
@ -118,46 +94,26 @@ describe('with-config', () => {
})
test('/test/error', async () => {
// const logSpy = await interceptLog()
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
expect(html.includes('Error page')).toBe(true)
})
test('/test/user-agent', async () => {
// const logSpy = await interceptLog()
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
expect(html.includes('<pre>Mozilla')).toBe(true)
})
test('/test/about-bis (added with extendRoutes)', async () => {
// const logSpy = await interceptLog()
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
expect(html.includes('<h1>Custom layout</h1>')).toBe(true)
expect(html.includes('<h1>About page</h1>')).toBe(true)
})
test('/test/redirect/about-bis (redirect with extendRoutes)', async () => {
// const logSpy = await interceptLog()
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
expect(windowHref.includes('/test/about-bis')).toBe(true)