@@ -40,18 +40,37 @@ function minimalSchema(overrides = {}) {
4040 } ;
4141}
4242
43- describe ( 'th dev' , function ( ) {
44- it ( 'supports --dry-run (no side effects)' , function ( ) {
43+ describe ( 'th up/run/ dev' , function ( ) {
44+ it ( 'supports --dry-run (no side effects) via th up ' , function ( ) {
4545 const dir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'th-dev-' ) ) ;
4646 const schemaPath = path . join ( dir , 'schema.json' ) ;
4747 writeJson ( schemaPath , minimalSchema ( ) ) ;
4848
49- const res = runTh ( [ 'dev ' , schemaPath , '--dry-run' ] , process . cwd ( ) ) ;
49+ const res = runTh ( [ 'up ' , schemaPath , '--dry-run' ] , process . cwd ( ) ) ;
5050 expect ( res . status , res . stderr || res . stdout ) . to . equal ( 0 ) ;
5151 expect ( res . stdout ) . to . include ( 'Plan:' ) ;
5252 expect ( res . stdout ) . to . include ( '- build:' ) ;
5353 expect ( res . stdout ) . to . include ( '- deploy:' ) ;
5454 expect ( res . stdout ) . to . include ( '- preview:' ) ;
5555 } ) ;
56- } ) ;
5756
57+ it ( 'supports --dry-run via th run alias' , function ( ) {
58+ const dir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'th-run-' ) ) ;
59+ const schemaPath = path . join ( dir , 'schema.json' ) ;
60+ writeJson ( schemaPath , minimalSchema ( ) ) ;
61+
62+ const res = runTh ( [ 'run' , schemaPath , '--dry-run' ] , process . cwd ( ) ) ;
63+ expect ( res . status , res . stderr || res . stdout ) . to . equal ( 0 ) ;
64+ expect ( res . stdout ) . to . include ( 'Plan:' ) ;
65+ } ) ;
66+
67+ it ( 'keeps th dev alias working' , function ( ) {
68+ const dir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'th-dev-' ) ) ;
69+ const schemaPath = path . join ( dir , 'schema.json' ) ;
70+ writeJson ( schemaPath , minimalSchema ( ) ) ;
71+
72+ const res = runTh ( [ 'dev' , schemaPath , '--dry-run' ] , process . cwd ( ) ) ;
73+ expect ( res . status , res . stderr || res . stdout ) . to . equal ( 0 ) ;
74+ expect ( res . stdout ) . to . include ( 'Plan:' ) ;
75+ } ) ;
76+ } ) ;
0 commit comments