refactor: promise in test is passed

This commit is contained in:
Clark Du 2018-04-18 23:56:03 +08:00
parent b6c45b81a9
commit e9a810a253
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9
2 changed files with 3 additions and 8 deletions

View File

@ -145,11 +145,8 @@ describe('basic generate', () => {
}) })
test('nuxt re-generating with no subfolders', async () => { test('nuxt re-generating with no subfolders', async () => {
// const logSpy = await interceptLog()
nuxt.options.generate.subFolders = false nuxt.options.generate.subFolders = false
await generator.generate({ build: false }) await expect(generator.generate({ build: false })).resolves.toBeTruthy()
// release()
// expect(logSpy.calledWithMatch('DONE')).toBe(true)
}) })
test('/users/1.html', async () => { test('/users/1.html', async () => {

View File

@ -41,10 +41,8 @@ describe('fallback generate', () => {
}) })
test('nuxt re-generating with generate.fallback = false', async () => { test('nuxt re-generating with generate.fallback = false', async () => {
// const logSpy = await interceptLog(async () => {
nuxt.options.generate.fallback = false nuxt.options.generate.fallback = false
await generator.generate({ build: false }) await expect(generator.generate({ build: false })).resolves.toBeTruthy()
// expect(logSpy.calledWithMatch('DONE')).toBe(true)
}) })
test('false creates no fallback', async () => { test('false creates no fallback', async () => {
@ -69,7 +67,7 @@ describe('fallback generate', () => {
'nuxt re-generating with generate.fallback = "spa-fallback.html"', 'nuxt re-generating with generate.fallback = "spa-fallback.html"',
async () => { async () => {
nuxt.options.generate.fallback = 'spa-fallback.html' nuxt.options.generate.fallback = 'spa-fallback.html'
await generator.generate({ build: false }) await expect(generator.generate({ build: false })).resolves.toBeTruthy()
} }
) )