@@ -2,8 +2,8 @@ import * as path from "path";
22import * as tstl from "../../src" ;
33import * as util from "../util" ;
44
5- const testTransform = ( transform : string ) => {
6- const options : tstl . CompilerOptions = { tsTransformers : [ { transform } ] } ;
5+ const testTransform = ( name : string ) => {
6+ const options : tstl . CompilerOptions = { tsTransformers : [ { name } ] } ;
77 expect ( util . transpileAndExecute ( "return" , options ) ) . toBe ( true ) ;
88} ;
99
@@ -21,23 +21,23 @@ test("should load ts transformers", () => {
2121} ) ;
2222
2323test ( "should pass program to transformers" , ( ) => {
24- const transform = path . join ( __dirname , "transformers/program.ts" ) ;
25- const options : tstl . CompilerOptions = { tsTransformers : [ { transform } ] } ;
24+ const name = path . join ( __dirname , "transformers/program.ts" ) ;
25+ const options : tstl . CompilerOptions = { tsTransformers : [ { name } ] } ;
2626
2727 expect ( util . transpileAndExecute ( "return false" , options ) ) . toBe ( true ) ;
2828} ) ;
2929
3030test ( "should pass extra options to transformers" , ( ) => {
31- const transform = path . join ( __dirname , "transformers/options.ts" ) ;
31+ const name = path . join ( __dirname , "transformers/options.ts" ) ;
3232 const value = "foo" ;
33- const options : tstl . CompilerOptions = { tsTransformers : [ { transform , value } ] } ;
33+ const options : tstl . CompilerOptions = { tsTransformers : [ { name , value } ] } ;
3434
3535 expect ( util . transpileAndExecute ( "return" , options ) ) . toBe ( value ) ;
3636} ) ;
3737
3838test ( "should error if transformer could not be resolved" , ( ) => {
39- const transform = path . join ( __dirname , "transformers/error.ts" ) ;
40- const options : tstl . CompilerOptions = { tsTransformers : [ { transform } ] } ;
39+ const name = path . join ( __dirname , "transformers/error.ts" ) ;
40+ const options : tstl . CompilerOptions = { tsTransformers : [ { name } ] } ;
4141 const { diagnostics } = util . transpileStringResult ( "" , options ) ;
4242 expect ( diagnostics ) . toHaveDiagnostics ( ) ;
4343} ) ;
0 commit comments