mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 13:15:12 +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'
|
||||
])
|
||||
})
|
||||
|
||||
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 sequence: string[] = []
|
||||
const plugins = [
|
||||
pluginFactory('A', undefined, sequence),
|
||||
pluginFactory('B', ['A', 'C'], sequence),
|
||||
pluginFactory('C', undefined, sequence)
|
||||
defineNuxtPlugin({
|
||||
name: 'A',
|
||||
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)
|
||||
|
||||
expect(sequence).toMatchObject([
|
||||
'start A',
|
||||
'start C',
|
||||
'end A',
|
||||
'start C',
|
||||
'end C',
|
||||
'start B',
|
||||
'end B'
|
||||
'end B',
|
||||
])
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user