Skip to content

Commit a1a4cb9

Browse files
committed
test: cover the banner path with a single version to join
1 parent ec34eee commit a1a4cb9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎packages/nuxt-cli/test/unit/utils/banner.spec.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const VERSIONS: Record<string, string> = {
1616
constCWD_VERSIONS: Record<string,Record<string,string>>={
1717
'/no-owner': {nitro: ''},
1818
'/no-nitro': {nitro: '',nitropack: ''},
19+
'/no-vue': {vue: ''},
1920
}
2021

2122
constNUXT_WITH_NITROPACK={name: 'nuxt',version: '4.4.6',dependencies: {nitropack: '^2.13.4'}}
@@ -30,6 +31,7 @@ const MANIFESTS: Record<string, Record<string, unknown>> = {
3031
'/direct-server': {'nuxt': NUXT_WITH_NITROPACK,'@nuxt/nitro-server': NITRO_SERVER},
3132
'/no-owner': {},
3233
'/no-nitro': {},
34+
'/no-vue': {nuxt: NUXT_WITH_NITROPACK},
3335
}
3436

3537
vi.mock('../../../src/utils/pkg',()=>({
@@ -144,4 +146,14 @@ describe('showBanner', () => {
144146
● Nuxt 4.4.6 (with Nitro 2.13.4, Vite 8.1.5 via Vite+ 0.2.6 and Vue 3.5.39)"
145147
`)
146148
})
149+
150+
it('should print a single version without a conjunction',async()=>{
151+
constrenderer=awaitrender(()=>
152+
showBanner({_version: '4.4.6',options: {rootDir: '/no-vue',builder: 'vite'}}asunknownasNuxt))
153+
154+
expect(screen(renderer)).toMatchInlineSnapshot(`
155+
"│
156+
● Nuxt 4.4.6 (with Nitro 2.13.4 and Vite 7.3.1)"
157+
`)
158+
})
147159
})

0 commit comments

Comments
 (0)