@@ -41,12 +41,20 @@ describe('SamCliLocalInvokeInvocation', async () => {
41
41
await del ( [ tempFolder ] , { force : true } )
42
42
} )
43
43
44
- it ( 'Passes local invoke command to sam cli ' , async ( ) => {
44
+ it ( 'invokes `sam local` with args ' , async ( ) => {
45
45
const taskInvoker : SamLocalInvokeCommand = new TestSamLocalInvokeCommand (
46
46
( invokeArgs : SamLocalInvokeCommandArgs ) => {
47
47
assert . ok ( invokeArgs . args . length >= 2 , 'Expected args to be present' )
48
- assert . strictEqual ( invokeArgs . args [ 0 ] , 'local' , 'Expected first arg to be local' )
49
- assert . strictEqual ( invokeArgs . args [ 1 ] , 'invoke' , 'Expected second arg to be invoke' )
48
+ assert . strictEqual ( invokeArgs . args [ 0 ] , 'local' )
49
+ assert . strictEqual ( invokeArgs . args [ 1 ] , 'invoke' )
50
+ assert . strictEqual ( invokeArgs . args [ 3 ] , '--template' )
51
+ assert . strictEqual ( invokeArgs . args [ 5 ] , '--event' )
52
+ assert . strictEqual ( invokeArgs . args [ 7 ] , '--env-vars' )
53
+
54
+ // `extraArgs` are appended to the end.
55
+ assert . strictEqual ( invokeArgs . args [ 9 ] , '--debug' )
56
+ assert . strictEqual ( invokeArgs . args [ 10 ] , '--build-dir' )
57
+ assert . strictEqual ( invokeArgs . args [ 11 ] , 'my/build/dir/' )
50
58
}
51
59
)
52
60
@@ -56,6 +64,7 @@ describe('SamCliLocalInvokeInvocation', async () => {
56
64
eventPath : placeholderEventFile ,
57
65
environmentVariablePath : nonRelevantArg ,
58
66
invoker : taskInvoker ,
67
+ extraArgs : [ '--debug' , '--build-dir' , 'my/build/dir/' ] ,
59
68
} ) . execute ( )
60
69
} )
61
70
0 commit comments