11// Copyright 2022-2024 The MathWorks, Inc.
22
3+ import * as path from "path" ;
34import * as buildtool from "./buildtool" ;
45
56describe ( "command generation" , ( ) => {
7+ const command = "addpath('" + path . join ( __dirname , "plugins" ) . replaceAll ( "'" , "''" ) + "'); buildtool"
68 it ( "buildtool invocation with unspecified tasks and build options" , ( ) => {
79 const options : buildtool . RunBuildOptions = {
810 Tasks : "" ,
911 BuildOptions : "" ,
1012 } ;
1113
1214 const actual = buildtool . generateCommand ( options ) ;
13- expect ( actual ) . toBe ( "buildtool" )
15+ expect ( actual ) . toBe ( command )
1416 } ) ;
1517
1618 it ( "buildtool invocation with tasks specified" , ( ) => {
@@ -19,7 +21,7 @@ describe("command generation", () => {
1921 } ;
2022
2123 const actual = buildtool . generateCommand ( options ) ;
22- expect ( actual ) . toBe ( "buildtool compile test")
24+ expect ( actual ) . toBe ( command + " compile test")
2325 } ) ;
2426
2527 it ( "buildtool invocation with only build options" , ( ) => {
@@ -29,7 +31,7 @@ describe("command generation", () => {
2931 } ;
3032
3133 const actual = buildtool . generateCommand ( options ) ;
32- expect ( actual ) . toBe ( "buildtool -continueOnFailure -skip check")
34+ expect ( actual ) . toBe ( command + " -continueOnFailure -skip check")
3335 } ) ;
3436
3537 it ( "buildtool invocation with specified tasks and build options" , ( ) => {
@@ -39,6 +41,6 @@ describe("command generation", () => {
3941 } ;
4042
4143 const actual = buildtool . generateCommand ( options ) ;
42- expect ( actual ) . toBe ( "buildtool compile test -continueOnFailure -skip check")
44+ expect ( actual ) . toBe ( command + " compile test -continueOnFailure -skip check")
4345 } ) ;
4446} ) ;
0 commit comments