mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +00:00
test: correct test according to #25305. Failing on main branch
This commit is contained in:
parent
e231357dbb
commit
57fe967f14
@ -244,24 +244,43 @@ describe('plugin dependsOn', () => {
|
|||||||
'end B'
|
'end B'
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('expect B to execute after A, C when B depends on A and C', async () => {
|
it('expect B to execute after A, C when B depends on A and C #25305', async () => {
|
||||||
const nuxtApp = useNuxtApp()
|
const nuxtApp = useNuxtApp()
|
||||||
const sequence: string[] = []
|
const sequence: string[] = []
|
||||||
const plugins = [
|
const plugins = [
|
||||||
pluginFactory('A', undefined, sequence),
|
defineNuxtPlugin({
|
||||||
pluginFactory('B', ['A', 'C'], sequence),
|
name: 'A',
|
||||||
pluginFactory('C', undefined, sequence)
|
async setup () {
|
||||||
|
sequence.push('start A')
|
||||||
|
sequence.push('end A')
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
defineNuxtPlugin({
|
||||||
|
name: 'B',
|
||||||
|
dependsOn: ['A', 'C'],
|
||||||
|
async setup () {
|
||||||
|
sequence.push('start B')
|
||||||
|
sequence.push('end B')
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
defineNuxtPlugin({
|
||||||
|
name: 'C',
|
||||||
|
async setup () {
|
||||||
|
sequence.push('start C')
|
||||||
|
sequence.push('end C')
|
||||||
|
}
|
||||||
|
})
|
||||||
]
|
]
|
||||||
await applyPlugins(nuxtApp, plugins)
|
await applyPlugins(nuxtApp, plugins)
|
||||||
|
|
||||||
expect(sequence).toMatchObject([
|
expect(sequence).toMatchObject([
|
||||||
'start A',
|
'start A',
|
||||||
'start C',
|
|
||||||
'end A',
|
'end A',
|
||||||
|
'start C',
|
||||||
'end C',
|
'end C',
|
||||||
'start B',
|
'start B',
|
||||||
'end B'
|
'end B',
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user