@@ -18,8 +18,9 @@ const nuxi = fileURLToPath(new URL('../../bin/nuxi.mjs', import.meta.url))
1818
1919describe ( 'commands' , ( ) => {
2020 const tests : Record < keyof typeof commands , 'todo' | TestFunction < object > > = {
21- _dev : 'todo' ,
22- add : async ( ) => {
21+ '_dev' : 'todo' ,
22+ 'add' : 'todo' ,
23+ 'add-template' : async ( ) => {
2324 const file = join ( fixtureDir , 'server/api/test.ts' )
2425 await rm ( file , { force : true } )
2526 await x ( nuxi , [ 'add' , 'api' , 'test' ] , {
@@ -29,8 +30,8 @@ describe('commands', () => {
2930 expect ( existsSync ( file ) ) . toBeTruthy ( )
3031 await rm ( file , { force : true } )
3132 } ,
32- analyze : 'todo' ,
33- build : async ( ) => {
33+ ' analyze' : 'todo' ,
34+ ' build' : async ( ) => {
3435 const res = await x ( nuxi , [ 'build' ] , {
3536 throwOnError : true ,
3637 nodeOptions : { stdio : 'pipe' , cwd : fixtureDir } ,
@@ -40,16 +41,16 @@ describe('commands', () => {
4041 expect ( existsSync ( join ( fixtureDir , '.output/server' ) ) ) . toBeTruthy ( )
4142 expect ( existsSync ( join ( fixtureDir , '.output/public' ) ) ) . toBeTruthy ( )
4243 } ,
43- cleanup : async ( ) => {
44+ ' cleanup' : async ( ) => {
4445 const res = await x ( nuxi , [ 'cleanup' ] , {
4546 throwOnError : true ,
4647 nodeOptions : { stdio : 'pipe' , cwd : fixtureDir } ,
4748 } )
4849 expect ( res . exitCode ) . toBe ( 0 )
4950 } ,
50- devtools : 'todo' ,
51- module : 'todo' ,
52- prepare : async ( ) => {
51+ ' devtools' : 'todo' ,
52+ ' module' : 'todo' ,
53+ ' prepare' : async ( ) => {
5354 const res = await x ( nuxi , [ 'prepare' ] , {
5455 throwOnError : true ,
5556 nodeOptions : { stdio : 'pipe' , cwd : fixtureDir } ,
@@ -58,7 +59,7 @@ describe('commands', () => {
5859 expect ( existsSync ( join ( fixtureDir , '.nuxt' ) ) ) . toBeTruthy ( )
5960 expect ( existsSync ( join ( fixtureDir , '.nuxt/types' ) ) ) . toBeTruthy ( )
6061 } ,
61- preview : async ( ) => {
62+ ' preview' : async ( ) => {
6263 await x ( nuxi , [ 'build' ] , {
6364 throwOnError : true ,
6465 nodeOptions : { stdio : 'pipe' , cwd : fixtureDir } ,
@@ -76,17 +77,17 @@ describe('commands', () => {
7677
7778 previewProcess . kill ( )
7879 } ,
79- start : 'todo' ,
80- test : 'todo' ,
81- typecheck : async ( ) => {
80+ ' start' : 'todo' ,
81+ ' test' : 'todo' ,
82+ ' typecheck' : async ( ) => {
8283 const res = await x ( nuxi , [ 'typecheck' ] , {
8384 throwOnError : true ,
8485 nodeOptions : { stdio : 'pipe' , cwd : fixtureDir } ,
8586 } )
8687 expect ( res . exitCode ) . toBe ( 0 )
8788 } ,
88- upgrade : 'todo' ,
89- dev : async ( ) => {
89+ ' upgrade' : 'todo' ,
90+ ' dev' : async ( ) => {
9091 const controller = new AbortController ( )
9192 const port = await getPort ( { host : '127.0.0.1' , port : 3001 } )
9293 const devProcess = x ( nuxi , [ 'dev' , `--host=127.0.0.1` , `--port=${ port } ` ] , {
@@ -104,7 +105,7 @@ describe('commands', () => {
104105 }
105106 catch { }
106107 } ,
107- generate : async ( ) => {
108+ ' generate' : async ( ) => {
108109 const res = await x ( nuxi , [ 'generate' ] , {
109110 throwOnError : true ,
110111 nodeOptions : { stdio : 'pipe' , cwd : fixtureDir } ,
@@ -113,7 +114,7 @@ describe('commands', () => {
113114 expect ( existsSync ( join ( fixtureDir , 'dist' ) ) ) . toBeTruthy ( )
114115 expect ( existsSync ( join ( fixtureDir , 'dist/index.html' ) ) ) . toBeTruthy ( )
115116 } ,
116- init : async ( ) => {
117+ ' init' : async ( ) => {
117118 const dir = tmpdir ( )
118119 const pm = 'pnpm'
119120 const installPath = join ( dir , pm )
@@ -131,7 +132,7 @@ describe('commands', () => {
131132 await rm ( installPath , { recursive : true , force : true } )
132133 }
133134 } ,
134- info : 'todo' ,
135+ ' info' : 'todo' ,
135136 }
136137
137138 it ( 'throws error if no command is provided' , async ( ) => {
0 commit comments