11// Copyright 2022-2024 The MathWorks, Inc.
22
3- import * as path from "path" ;
43import * as buildtool from "./buildtool" ;
54
65describe ( "command generation" , ( ) => {
7- const command = "addpath('" + path . join ( __dirname , "plugins" ) . replaceAll ( "'" , "''" ) + "'); buildtool"
86 it ( "buildtool invocation with unspecified tasks and build options" , ( ) => {
97 const options : buildtool . RunBuildOptions = {
108 Tasks : "" ,
119 BuildOptions : "" ,
1210 } ;
1311
1412 const actual = buildtool . generateCommand ( options ) ;
15- expect ( actual ) . toBe ( command )
13+ expect ( actual ) . toBe ( "buildtool" )
1614 } ) ;
1715
1816 it ( "buildtool invocation with tasks specified" , ( ) => {
@@ -21,7 +19,7 @@ const command = "addpath('"+ path.join(__dirname, "plugins").replaceAll("'","''"
2119 } ;
2220
2321 const actual = buildtool . generateCommand ( options ) ;
24- expect ( actual ) . toBe ( command + " compile test")
22+ expect ( actual ) . toBe ( "buildtool compile test")
2523 } ) ;
2624
2725 it ( "buildtool invocation with only build options" , ( ) => {
@@ -31,7 +29,7 @@ const command = "addpath('"+ path.join(__dirname, "plugins").replaceAll("'","''"
3129 } ;
3230
3331 const actual = buildtool . generateCommand ( options ) ;
34- expect ( actual ) . toBe ( command + " -continueOnFailure -skip check")
32+ expect ( actual ) . toBe ( "buildtool -continueOnFailure -skip check")
3533 } ) ;
3634
3735 it ( "buildtool invocation with specified tasks and build options" , ( ) => {
@@ -41,6 +39,6 @@ const command = "addpath('"+ path.join(__dirname, "plugins").replaceAll("'","''"
4139 } ;
4240
4341 const actual = buildtool . generateCommand ( options ) ;
44- expect ( actual ) . toBe ( command + " compile test -continueOnFailure -skip check")
42+ expect ( actual ) . toBe ( "buildtool compile test -continueOnFailure -skip check")
4543 } ) ;
4644} ) ;
0 commit comments