@@ -3,6 +3,8 @@ import { Program } from '../../Program';
33import { standardizePath as s } from '../../util' ;
44import * as fsExtra from 'fs-extra' ;
55import undent from 'undent' ;
6+ import { AstEditor } from '../../astUtils/AstEditor' ;
7+ import { TreeShaker } from './TreeShaker' ;
68
79describe ( 'TreeShaker' , ( ) => {
810 let program : Program ;
@@ -927,7 +929,7 @@ describe('TreeShaker', () => {
927929 } ) ;
928930
929931 describe ( 'src rule' , ( ) => {
930- it ( 'does not set needsTranspiled on a .brs file fully covered by a src keep rule' , async ( ) => {
932+ it ( 'does not set needsTranspiled on a .brs file fully covered by a src keep rule' , ( ) => {
931933 // When every function in a .brs file is kept by a keep rule, shake() never
932934 // replaces any statement, so needsTranspiled must stay false. This prevents
933935 // the BrighterScript transpiler from running on the file and applying
@@ -953,10 +955,7 @@ describe('TreeShaker', () => {
953955 ` ) ;
954956
955957 program . validate ( ) ;
956- // Trigger the shake pass the same way Program.beforeProgramTranspile does
957- const { AstEditor } = require ( '../../astUtils/AstEditor' ) ;
958958 const editor = new AstEditor ( ) ;
959- const { TreeShaker } = require ( './TreeShaker' ) ;
960959 const shaker = new TreeShaker ( ) ;
961960 shaker . analyze ( program , program . options . treeShaking . keep ) ;
962961
0 commit comments