@@ -10,7 +10,7 @@ describe("e2e: config", () => {
1010 const { stdout, stderr, exitCode } = await runCli ( [ "config" ] ) ;
1111 expect ( exitCode , stderr ) . toBe ( 0 ) ;
1212 const out = `${ stdout } \n${ stderr } ` ;
13- expect ( out ) . toMatch ( / c o n f i g | s h o w | s e t | e x p o r t - s c h e m a / i) ;
13+ expect ( out ) . toMatch ( / c o n f i g | s h o w | s e t / i) ;
1414 } ) ;
1515
1616 test ( "config show --help 正常退出" , async ( ) => {
@@ -25,12 +25,6 @@ describe("e2e: config", () => {
2525 expect ( stderr ) . toMatch ( / s e t | - - k e y | - - v a l u e / i) ;
2626 } ) ;
2727
28- test ( "config export-schema --help 正常退出" , async ( ) => {
29- const { stderr, exitCode } = await runCli ( [ "config" , "export-schema" , "--help" ] ) ;
30- expect ( exitCode , stderr ) . toBe ( 0 ) ;
31- expect ( stderr ) . toMatch ( / e x p o r t - s c h e m a | - - c o m m a n d / i) ;
32- } ) ;
33-
3428 test ( "config show --output json" , async ( ) => {
3529 const { stdout, stderr, exitCode } = await runCli ( [
3630 "config" ,
@@ -146,46 +140,4 @@ describe("e2e: config", () => {
146140 const data = parseStdoutJson < { would_set ?: { default_text_model ?: string } } > ( stdout ) ;
147141 expect ( data . would_set ?. default_text_model ) . toBe ( "qwen3.7-max" ) ;
148142 } ) ;
149-
150- test ( "config export-schema --command 导出单条工具 JSON" , async ( ) => {
151- const { stdout, stderr, exitCode } = await runCli ( [
152- "config" ,
153- "export-schema" ,
154- "--command" ,
155- "text chat" ,
156- "--non-interactive" ,
157- ] ) ;
158- expect ( exitCode , stderr ) . toBe ( 0 ) ;
159- const schema = parseStdoutJson < { name ?: string ; input_schema ?: { type ?: string } } > ( stdout ) ;
160- expect ( schema . name ) . toMatch ( / b a i l i a n _ t e x t _ c h a t / ) ;
161- expect ( schema . input_schema ?. type ) . toBe ( "object" ) ;
162- } ) ;
163-
164- test ( "config export-schema 不存在的子命令时报错" , async ( ) => {
165- const { stderr, exitCode } = await runCli ( [
166- "config" ,
167- "export-schema" ,
168- "--command" ,
169- "this-command-does-not-exist-xyz" ,
170- "--non-interactive" ,
171- "--output" ,
172- "json" ,
173- ] ) ;
174- expect ( exitCode ) . toBe ( 2 ) ;
175- const err = JSON . parse ( stderr . trim ( ) ) as { error ?: { message ?: string } } ;
176- expect ( err . error ?. message ) . toMatch ( / n o t f o u n d / i) ;
177- } ) ;
178-
179- test ( "config export-schema 导出全部为 JSON 数组" , async ( ) => {
180- const { stdout, stderr, exitCode } = await runCli ( [
181- "config" ,
182- "export-schema" ,
183- "--non-interactive" ,
184- ] ) ;
185- expect ( exitCode , stderr ) . toBe ( 0 ) ;
186- const arr = parseStdoutJson < Array < { name ?: string } > > ( stdout ) ;
187- expect ( Array . isArray ( arr ) ) . toBe ( true ) ;
188- expect ( arr . length ) . toBeGreaterThan ( 0 ) ;
189- expect ( arr [ 0 ] ?. name ) . toMatch ( / ^ b a i l i a n _ / ) ;
190- } ) ;
191143} ) ;
0 commit comments