@@ -2,10 +2,6 @@ import * as path from "path";
22import * as tstl from "../../../src" ;
33import * as util from "../../util" ;
44
5- const optionsOfTransformer = ( transformer : tstl . TransformerImport ) : tstl . CompilerOptions => ( {
6- plugins : [ transformer ] ,
7- } ) ;
8-
95test ( "should ignore language service plugins" , ( ) => {
106 util . testFunction `
117 return;
@@ -19,7 +15,7 @@ describe("resolution", () => {
1915 util . testFunction `
2016 return;
2117 `
22- . setOptions ( optionsOfTransformer ( transformer ) )
18+ . setOptions ( { plugins : [ transformer ] } )
2319 . expectToEqual ( true ) ;
2420 } ;
2521
@@ -42,25 +38,20 @@ describe("resolution", () => {
4238
4339 test ( "error if transformer could not be resolved" , ( ) => {
4440 util . testModule ``
45- . setOptions ( optionsOfTransformer ( { transform : path . join ( __dirname , "error.ts" ) } ) )
41+ . setOptions ( { plugins : [ { transform : path . join ( __dirname , "error.ts" ) } ] } )
4642 . expectToHaveDiagnostics ( ) ;
4743 } ) ;
4844} ) ;
4945
5046describe ( "factory types" , ( ) => {
5147 for ( const type of [ "program" , "config" , "checker" , "raw" , "compilerOptions" ] as const ) {
5248 test ( type , ( ) => {
53- const options = optionsOfTransformer ( {
54- transform : path . join ( __dirname , "types.ts" ) ,
55- type,
56- import : type ,
57- value : true ,
58- } ) ;
59-
6049 util . testFunction `
6150 return false;
6251 `
63- . setOptions ( options )
52+ . setOptions ( {
53+ plugins : [ { transform : path . join ( __dirname , "types.ts" ) , type, import : type , value : true } ] ,
54+ } )
6455 . expectToEqual ( true ) ;
6556 } ) ;
6657 }
0 commit comments