@@ -7,7 +7,7 @@ test.each(invalidTestFunctionAssignments)(
77 util . testModule `
88 ${ testFunction . definition || "" }
99 const fn: ${ functionType } = ${ testFunction . value } ;
10- ` . expectDiagnosticsToMatchSnapshot ( true ) ;
10+ ` . expectDiagnosticsToMatchSnapshot ( undefined , true ) ;
1111 }
1212) ;
1313
@@ -16,47 +16,47 @@ test.each(invalidTestFunctionAssignments)("Invalid function assignment (%p)", (t
1616 ${ testFunction . definition || "" }
1717 let fn: ${ functionType } ;
1818 fn = ${ testFunction . value } ;
19- ` . expectDiagnosticsToMatchSnapshot ( true ) ;
19+ ` . expectDiagnosticsToMatchSnapshot ( undefined , true ) ;
2020} ) ;
2121
2222test . each ( invalidTestFunctionCasts ) ( "Invalid function assignment with cast (%p)" , ( testFunction , castedFunction ) => {
2323 util . testModule `
2424 ${ testFunction . definition || "" }
2525 let fn: typeof ${ testFunction . value } ;
2626 fn = ${ castedFunction } ;
27- ` . expectDiagnosticsToMatchSnapshot ( true ) ;
27+ ` . expectDiagnosticsToMatchSnapshot ( undefined , true ) ;
2828} ) ;
2929
3030test . each ( invalidTestFunctionAssignments ) ( "Invalid function argument (%p)" , ( testFunction , functionType ) => {
3131 util . testModule `
3232 ${ testFunction . definition || "" }
3333 declare function takesFunction(fn: ${ functionType } );
3434 takesFunction(${ testFunction . value } );
35- ` . expectDiagnosticsToMatchSnapshot ( true ) ;
35+ ` . expectDiagnosticsToMatchSnapshot ( undefined , true ) ;
3636} ) ;
3737
3838test ( "Invalid lua lib function argument" , ( ) => {
3939 util . testModule `
4040 declare function foo(this: void, value: string): void;
4141 declare const a: string[];
4242 a.forEach(foo);
43- ` . expectDiagnosticsToMatchSnapshot ( true ) ;
43+ ` . expectDiagnosticsToMatchSnapshot ( undefined , true ) ;
4444} ) ;
4545
4646test . each ( invalidTestFunctionCasts ) ( "Invalid function argument with cast (%p)" , ( testFunction , castedFunction ) => {
4747 util . testModule `
4848 ${ testFunction . definition || "" }
4949 declare function takesFunction(fn: typeof ${ testFunction . value } );
5050 takesFunction(${ castedFunction } );
51- ` . expectDiagnosticsToMatchSnapshot ( true ) ;
51+ ` . expectDiagnosticsToMatchSnapshot ( undefined , true ) ;
5252} ) ;
5353
5454test . each ( invalidTestFunctionAssignments ) ( "Invalid function generic argument (%p)" , ( testFunction , functionType ) => {
5555 util . testModule `
5656 ${ testFunction . definition || "" }
5757 declare function takesFunction<T extends ${ functionType } >(fn: T);
5858 takesFunction(${ testFunction . value } );
59- ` . expectDiagnosticsToMatchSnapshot ( true ) ;
59+ ` . expectDiagnosticsToMatchSnapshot ( undefined , true ) ;
6060} ) ;
6161
6262test . each ( invalidTestFunctionAssignments ) ( "Invalid function return (%p)" , ( testFunction , functionType ) => {
@@ -65,7 +65,7 @@ test.each(invalidTestFunctionAssignments)("Invalid function return (%p)", (testF
6565 function returnsFunction(): ${ functionType } {
6666 return ${ testFunction . value } ;
6767 }
68- ` . expectDiagnosticsToMatchSnapshot ( true ) ;
68+ ` . expectDiagnosticsToMatchSnapshot ( undefined , true ) ;
6969} ) ;
7070
7171test . each ( invalidTestFunctionCasts ) ( "Invalid function return with cast (%p)" , ( testFunction , castedFunction ) => {
@@ -74,7 +74,7 @@ test.each(invalidTestFunctionCasts)("Invalid function return with cast (%p)", (t
7474 function returnsFunction(): typeof ${ testFunction . value } {
7575 return ${ castedFunction } ;
7676 }
77- ` . expectDiagnosticsToMatchSnapshot ( true ) ;
77+ ` . expectDiagnosticsToMatchSnapshot ( undefined , true ) ;
7878} ) ;
7979
8080test ( "Invalid function tuple assignment" , ( ) => {
@@ -83,7 +83,7 @@ test("Invalid function tuple assignment", () => {
8383 interface Meth { (this: {}, s: string): string; }
8484 declare function getTuple(): [number, Meth];
8585 let [i, f]: [number, Func] = getTuple();
86- ` . expectDiagnosticsToMatchSnapshot ( true ) ;
86+ ` . expectDiagnosticsToMatchSnapshot ( undefined , true ) ;
8787} ) ;
8888
8989test ( "Invalid method tuple assignment" , ( ) => {
@@ -92,7 +92,7 @@ test("Invalid method tuple assignment", () => {
9292 interface Meth { (this: {}, s: string): string; }
9393 declare function getTuple(): [number, Func];
9494 let [i, f]: [number, Meth] = getTuple();
95- ` . expectDiagnosticsToMatchSnapshot ( true ) ;
95+ ` . expectDiagnosticsToMatchSnapshot ( undefined , true ) ;
9696} ) ;
9797
9898test ( "Invalid interface method assignment" , ( ) => {
@@ -101,7 +101,7 @@ test("Invalid interface method assignment", () => {
101101 interface B { fn(this: void, s: string): string; }
102102 declare const a: A;
103103 const b: B = a;
104- ` . expectDiagnosticsToMatchSnapshot ( true ) ;
104+ ` . expectDiagnosticsToMatchSnapshot ( undefined , true ) ;
105105} ) ;
106106
107107test . each ( [
@@ -117,5 +117,5 @@ test.each([
117117 }
118118 declare const o: O;
119119 let f: ${ assignType } = o;
120- ` . expectDiagnosticsToMatchSnapshot ( true ) ;
120+ ` . expectDiagnosticsToMatchSnapshot ( undefined , true ) ;
121121} ) ;
0 commit comments