File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ export class TestBuilder {
253253 luaTarget : tstl . LuaTarget . Lua53 ,
254254 noHeader : true ,
255255 skipLibCheck : true ,
256- target : ts . ScriptTarget . ESNext ,
256+ target : ts . ScriptTarget . ES2017 ,
257257 lib : [ "lib.esnext.d.ts" ] ,
258258 experimentalDecorators : true ,
259259 } ;
@@ -366,12 +366,13 @@ export class TestBuilder {
366366 const { transpiledFiles } = this . getJsResult ( ) ;
367367 const mainFile = transpiledFiles . find ( x => x . fileName === this . _mainFileName ) ;
368368 expect ( mainFile ) . toBeDefined ( ) ;
369- return mainFile ! . js ! + `;exports = exports${ this . _accessor } ` ;
369+ return mainFile ! . js ! + `;module. exports = exports${ this . _accessor } ` ;
370370 }
371371
372372 @memoize
373373 public getJsExecutionResult ( ) : any {
374- const context = vm . createContext ( { exports : { } } ) ;
374+ const exports = { } ;
375+ const context = vm . createContext ( { exports, module : { exports } } ) ;
375376 try {
376377 return vm . runInContext ( this . getJsCode ( ) , context ) ;
377378 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments