mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
test: add await for promisable expect
This commit is contained in:
parent
43491f6e53
commit
fabf1c07eb
@ -92,7 +92,7 @@ describe('builder: builder plugins', () => {
|
||||
])
|
||||
})
|
||||
|
||||
test('should throw error if plugin no existed', () => {
|
||||
test('should throw error if plugin no existed', async () => {
|
||||
const nuxt = createNuxt()
|
||||
const builder = new Builder(nuxt, {})
|
||||
builder.plugins = [
|
||||
@ -100,7 +100,7 @@ describe('builder: builder plugins', () => {
|
||||
]
|
||||
Glob.mockImplementationOnce(() => [])
|
||||
|
||||
expect(builder.resolvePlugins()).rejects.toThrow('Plugin not found: /var/nuxt/plugins/test.js')
|
||||
await expect(builder.resolvePlugins()).rejects.toThrow('Plugin not found: /var/nuxt/plugins/test.js')
|
||||
})
|
||||
|
||||
test('should warn if there are multiple files and not index', async () => {
|
||||
|
@ -358,13 +358,13 @@ describe('core: module', () => {
|
||||
expect(result).toEqual({ test: true })
|
||||
})
|
||||
|
||||
test('should throw error when handler is not function', () => {
|
||||
test('should throw error when handler is not function', async () => {
|
||||
const module = new ModuleContainer({
|
||||
resolver: { requireModule: () => false },
|
||||
options: {}
|
||||
})
|
||||
|
||||
expect(module.addModule('moduleTest')).rejects.toThrow('Module should export a function: moduleTest')
|
||||
await expect(module.addModule('moduleTest')).rejects.toThrow('Module should export a function: moduleTest')
|
||||
})
|
||||
|
||||
test('should prevent multiple adding when requireOnce is enabled', async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user