fix(test): unhandled open handles

This commit is contained in:
Clark Du 2019-02-04 12:39:54 +00:00
parent fabf1c07eb
commit 858c9eeb5d

View File

@ -489,6 +489,8 @@ describe('builder: builder generate', () => {
layouts: '/var/nuxt/src/layouts' layouts: '/var/nuxt/src/layouts'
} }
const builder = new Builder(nuxt, {}) const builder = new Builder(nuxt, {})
builder.resolveFiles = jest.fn()
fs.exists.mockReturnValueOnce(false)
const templateVars = { const templateVars = {
layouts: { layouts: {
@ -496,7 +498,6 @@ describe('builder: builder generate', () => {
} }
} }
await builder.resolveLayouts({ templateVars }) await builder.resolveLayouts({ templateVars })
builder.resolveFiles = jest.fn()
expect(path.resolve).toBeCalledTimes(1) expect(path.resolve).toBeCalledTimes(1)
expect(path.resolve).toBeCalledWith('/var/nuxt/src', '/var/nuxt/src/layouts') expect(path.resolve).toBeCalledWith('/var/nuxt/src', '/var/nuxt/src/layouts')
@ -541,7 +542,7 @@ describe('builder: builder generate', () => {
expect(builder.routes).toEqual(templateVars.router.routes) expect(builder.routes).toEqual(templateVars.router.routes)
}) })
test('should resolve routes from defualt pages dir', async () => { test('should resolve routes from default pages dir', async () => {
const nuxt = createNuxt() const nuxt = createNuxt()
nuxt.options.srcDir = '/var/nuxt/src' nuxt.options.srcDir = '/var/nuxt/src'
nuxt.options.build = { nuxt.options.build = {