From 57fe967f142966d4d6de7d815fbe81ad68853325 Mon Sep 17 00:00:00 2001 From: julien huang Date: Fri, 19 Jan 2024 18:22:43 +0100 Subject: [PATCH] test: correct test according to #25305. Failing on main branch --- test/nuxt/plugin.test.ts | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/test/nuxt/plugin.test.ts b/test/nuxt/plugin.test.ts index c924fa6eb8..3af5b99a8c 100644 --- a/test/nuxt/plugin.test.ts +++ b/test/nuxt/plugin.test.ts @@ -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', ]) }) })