From e9a810a253caf717b9bce2818ff513eeb090295e Mon Sep 17 00:00:00 2001 From: Clark Du Date: Wed, 18 Apr 2018 23:56:03 +0800 Subject: [PATCH] refactor: promise in test is passed --- test/unit/basic.generate.test.js | 5 +---- test/unit/fallback.generate.test.js | 6 ++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/test/unit/basic.generate.test.js b/test/unit/basic.generate.test.js index 3c38807c3c..59c19b9ea4 100644 --- a/test/unit/basic.generate.test.js +++ b/test/unit/basic.generate.test.js @@ -145,11 +145,8 @@ describe('basic generate', () => { }) test('nuxt re-generating with no subfolders', async () => { - // const logSpy = await interceptLog() nuxt.options.generate.subFolders = false - await generator.generate({ build: false }) - // release() - // expect(logSpy.calledWithMatch('DONE')).toBe(true) + await expect(generator.generate({ build: false })).resolves.toBeTruthy() }) test('/users/1.html', async () => { diff --git a/test/unit/fallback.generate.test.js b/test/unit/fallback.generate.test.js index 07d1c2a0a6..d80bd818c6 100644 --- a/test/unit/fallback.generate.test.js +++ b/test/unit/fallback.generate.test.js @@ -41,10 +41,8 @@ describe('fallback generate', () => { }) test('nuxt re-generating with generate.fallback = false', async () => { - // const logSpy = await interceptLog(async () => { nuxt.options.generate.fallback = false - await generator.generate({ build: false }) - // expect(logSpy.calledWithMatch('DONE')).toBe(true) + await expect(generator.generate({ build: false })).resolves.toBeTruthy() }) test('false creates no fallback', async () => { @@ -69,7 +67,7 @@ describe('fallback generate', () => { 'nuxt re-generating with generate.fallback = "spa-fallback.html"', async () => { nuxt.options.generate.fallback = 'spa-fallback.html' - await generator.generate({ build: false }) + await expect(generator.generate({ build: false })).resolves.toBeTruthy() } )