@@ -6,66 +6,71 @@ import * as helpers from '../util/helpers';
6
6
7
7
let originalEnv : any = null ;
8
8
9
- const main = '/Users/noone/myApp/app/main.js' ;
10
- const appModule = '/Users/noone/myApp/app/app.module.js' ;
9
+ const baseDir = join ( process . cwd ( ) , 'some' , 'dir' , 'myApp' ) ;
10
+ const srcDir = join ( baseDir , 'src' ) ;
11
+ const main = join ( srcDir , 'app' , 'main.js' ) ;
12
+ const appModule = join ( srcDir , 'app' , 'app.module.js' ) ;
13
+ const nodeModulesDir = join ( baseDir , 'node_modules' ) ;
14
+ const ionicAngularDir = join ( nodeModulesDir , 'ionic-angular' ) ;
15
+ const ionicAngularEntryPoint = join ( ionicAngularDir , 'index.js' ) ;
16
+ const componentDir = join ( ionicAngularDir , 'components' ) ;
11
17
12
18
describe ( 'treeshake' , ( ) => {
13
- describe ( 'calculateTreeShakeResults' , ( ) => {
14
19
15
- beforeEach ( ( ) => {
16
- originalEnv = process . env ;
17
- let env : any = { } ;
18
- env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] = '/Users/noone/ionic-angular' ;
19
- env [ Constants . ENV_VAR_IONIC_ANGULAR_ENTRY_POINT ] = '/Users/noone/ionic-angular/index.js' ;
20
- env [ Constants . ENV_VAR_SRC_DIR ] = '/Users/noone/myApp/' ;
21
- env [ Constants . ENV_APP_ENTRY_POINT ] = main ;
22
- env [ Constants . ENV_APP_NG_MODULE_PATH ] = appModule ;
23
- env [ Constants . ENV_ACTION_SHEET_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'action-sheet' , 'action-sheet-component.ngfactory.js' ) ;
24
- env [ Constants . ENV_ACTION_SHEET_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'action-sheet' , 'action-sheet-controller.js' ) ;
25
- env [ Constants . ENV_ALERT_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'alert' , 'alert-component.ngfactory.js' ) ;
26
- env [ Constants . ENV_ALERT_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'alert' , 'alert-controller.js' ) ;
27
- env [ Constants . ENV_LOADING_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'loading' , 'loading-component.ngfactory.js' ) ;
28
- env [ Constants . ENV_LOADING_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'loading' , 'loading-controller.js' ) ;
29
- env [ Constants . ENV_MODAL_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'modal' , 'modal-component.ngfactory.js' ) ;
30
- env [ Constants . ENV_MODAL_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'modal' , 'modal-controller.js' ) ;
31
- env [ Constants . ENV_PICKER_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'picker' , 'picker-component.ngfactory.js' ) ;
32
- env [ Constants . ENV_PICKER_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'picker' , 'picker-controller.js' ) ;
33
- env [ Constants . ENV_POPOVER_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'popover' , 'popover-component.ngfactory.js' ) ;
34
- env [ Constants . ENV_POPOVER_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'popover' , 'popover-controller.js' ) ;
35
- env [ Constants . ENV_TOAST_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'toast' , 'toast-component.ngfactory.js' ) ;
36
- env [ Constants . ENV_TOAST_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'toast' , 'toast-controller.js' ) ;
37
-
38
- process . env = env ;
39
- } ) ;
20
+ beforeEach ( ( ) => {
21
+ originalEnv = process . env ;
22
+ let env : any = { } ;
23
+ env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] = ionicAngularDir ;
24
+ env [ Constants . ENV_VAR_IONIC_ANGULAR_ENTRY_POINT ] = ionicAngularEntryPoint ;
25
+ env [ Constants . ENV_VAR_SRC_DIR ] = srcDir ;
26
+ env [ Constants . ENV_APP_ENTRY_POINT ] = main ;
27
+ env [ Constants . ENV_APP_NG_MODULE_PATH ] = appModule ;
28
+ env [ Constants . ENV_ACTION_SHEET_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'action-sheet' , 'action-sheet-component.ngfactory.js' ) ;
29
+ env [ Constants . ENV_ACTION_SHEET_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'action-sheet' , 'action-sheet-controller.js' ) ;
30
+ env [ Constants . ENV_ALERT_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'alert' , 'alert-component.ngfactory.js' ) ;
31
+ env [ Constants . ENV_ALERT_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'alert' , 'alert-controller.js' ) ;
32
+ env [ Constants . ENV_LOADING_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'loading' , 'loading-component.ngfactory.js' ) ;
33
+ env [ Constants . ENV_LOADING_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'loading' , 'loading-controller.js' ) ;
34
+ env [ Constants . ENV_MODAL_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'modal' , 'modal-component.ngfactory.js' ) ;
35
+ env [ Constants . ENV_MODAL_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'modal' , 'modal-controller.js' ) ;
36
+ env [ Constants . ENV_PICKER_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'picker' , 'picker-component.ngfactory.js' ) ;
37
+ env [ Constants . ENV_PICKER_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'picker' , 'picker-controller.js' ) ;
38
+ env [ Constants . ENV_POPOVER_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'popover' , 'popover-component.ngfactory.js' ) ;
39
+ env [ Constants . ENV_POPOVER_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'popover' , 'popover-controller.js' ) ;
40
+ env [ Constants . ENV_TOAST_COMPONENT_FACTORY_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'toast' , 'toast-component.ngfactory.js' ) ;
41
+ env [ Constants . ENV_TOAST_CONTROLLER_PATH ] = join ( env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] , 'components' , 'toast' , 'toast-controller.js' ) ;
42
+
43
+ process . env = env ;
44
+ } ) ;
40
45
41
- afterEach ( ( ) => {
42
- process . env = originalEnv ;
43
- } ) ;
46
+ afterEach ( ( ) => {
47
+ process . env = originalEnv ;
48
+ } ) ;
49
+
50
+ describe ( 'calculateTreeShakeResults' , ( ) => {
44
51
45
52
it ( 'should remove modules that are only imported by index' , ( ) => {
46
53
// arrange
47
54
48
- const dependencyOne = '/Users/noone/ionic-angular/components/range.js' ;
49
- const dependencyTwo = '/Users/noone/ionic-angular/components/radio-button.js' ;
50
- const dependencyThree = '/Users/noone/ionic-angular/components/check-box.js' ;
51
-
52
- const index = '/Users/noone/ionic-angular/index.js' ;
55
+ const dependencyOne = join ( componentDir , 'range.js' ) ;
56
+ const dependencyTwo = join ( componentDir , 'radio-button.js' ) ;
57
+ const dependencyThree = join ( componentDir , 'check-box.js' ) ;
53
58
54
59
const dependencyOneSet = new Set < string > ( ) ;
55
- dependencyOneSet . add ( index ) ;
60
+ dependencyOneSet . add ( ionicAngularEntryPoint ) ;
56
61
57
62
const dependencyTwoSet = new Set < string > ( ) ;
58
- dependencyTwoSet . add ( index ) ;
63
+ dependencyTwoSet . add ( ionicAngularEntryPoint ) ;
59
64
60
65
const dependencyThreeSet = new Set < string > ( ) ;
61
- dependencyThreeSet . add ( index ) ;
66
+ dependencyThreeSet . add ( ionicAngularEntryPoint ) ;
62
67
63
68
64
69
const dependencyMap = new Map < string , Set < string > > ( ) ;
65
70
dependencyMap . set ( dependencyOne , dependencyOneSet ) ;
66
71
dependencyMap . set ( dependencyTwo , dependencyTwoSet ) ;
67
72
dependencyMap . set ( dependencyThree , dependencyThreeSet ) ;
68
- dependencyMap . set ( index , new Set < string > ( ) ) ;
73
+ dependencyMap . set ( ionicAngularEntryPoint , new Set < string > ( ) ) ;
69
74
70
75
// act
71
76
const results = treeshake . calculateUnusedComponents ( dependencyMap ) ;
@@ -82,34 +87,32 @@ describe('treeshake', () => {
82
87
it ( 'should remove other components that are imported only by index or other modules that can be removed (only imported by index)' , ( ) => {
83
88
// arrange
84
89
85
- const dependencyOne = '/Users/noone/ionic-angular/components/range.js' ;
86
- const dependencyOneNgFactory = '/Users/noone/ionic-angular/components/range.ngfactory.js' ;
87
-
88
- const dependencyOneHelperOne = '/Users/noone/ionic-angular/components/range/helperOne.js' ;
89
- const dependencyOneHelperTwo = '/Users/noone/ionic-angular/components/range/helperTwo.js' ;
90
+ const dependencyOne = join ( componentDir , 'range.js' ) ;
91
+ const dependencyOneNgFactory = join ( componentDir , 'range.ngfactory.js' ) ;
90
92
91
- const dependencyTwo = '/Users/noone/ionic-angular/components/radio-button .js';
92
- const dependencyThree = '/Users/noone/ionic-angular/components/check-box .js';
93
+ const dependencyOneHelperOne = join ( componentDir , 'range' , 'helperOne .js') ;
94
+ const dependencyOneHelperTwo = join ( componentDir , 'range' , 'helperTwo .js') ;
93
95
94
- const dependencyFour = '/Users/noone/ionic-angular/components/badge .js';
95
- const dependencyFourNgFactory = '/Users/noone/ionic-angular/components/badge.ngfactory. js';
96
+ const dependencyTwo = join ( componentDir , 'radio-button .js') ;
97
+ const dependencyThree = join ( componentDir , 'check-box. js') ;
96
98
97
- const appModuleNgFactory = '/Users/noone/myApp/app/app.module.ngfactory.js' ;
99
+ const dependencyFour = join ( componentDir , 'badge.js' ) ;
100
+ const dependencyFourNgFactory = join ( componentDir , 'badge.ngfactory.js' ) ;
98
101
99
- const alert = '/Users/noone/ionic-angular/components/alert/alert.js' ;
100
- const alertController = '/Users/noone/ionic-angular/components/alert/alert-controller.js' ;
101
- const alertComponent = '/Users/noone/ionic-angular/components/alert/alert-component.js' ;
102
- const alertComponentNgFactory = '/Users/noone/ionic-angular/components/alert/alert-component.ngfactory.js' ;
102
+ const appModuleNgFactory = join ( srcDir , 'app' , 'app.module.ngfactory.js' ) ;
103
103
104
- const actionSheet = '/Users/noone/ionic-angular/components/action-sheet/action-sheet .js';
105
- const actionSheetController = '/Users/noone/ionic-angular/components/action-sheet/action-sheet- controller.js';
106
- const actionSheetComponent = '/Users/noone/ionic-angular/components/action-sheet/action-sheet- component.js';
107
- const actionSheetComponentNgFactory = '/Users/noone/ionic-angular/components/action-sheet/action-sheet- component.ngfactory.js';
104
+ const alert = join ( componentDir , 'alert' , 'alert .js') ;
105
+ const alertController = join ( componentDir , 'alert' , 'alert- controller.js') ;
106
+ const alertComponent = join ( componentDir , 'alert' , 'alert- component.js') ;
107
+ const alertComponentNgFactory = join ( componentDir , 'alert' , 'alert- component.ngfactory.js') ;
108
108
109
- const home = '/Users/noone/myApp/pages/home.js' ;
110
- const homeNgFactory = '/Users/noone/myApp/pages/home.ngfactory.js' ;
109
+ const actionSheet = join ( componentDir , 'action-sheet' , 'action-sheet.js' ) ;
110
+ const actionSheetController = join ( componentDir , 'action-sheet' , 'action-sheet-controller.js' ) ;
111
+ const actionSheetComponent = join ( componentDir , 'action-sheet' , 'action-sheet-component.js' ) ;
112
+ const actionSheetComponentNgFactory = join ( componentDir , 'action-sheet' , 'action-sheet-component.ngfactory.js' ) ;
111
113
112
- const index = '/Users/noone/ionic-angular/index.js' ;
114
+ const home = join ( srcDir , 'pages' , 'home.js' ) ;
115
+ const homeNgFactory = join ( srcDir , 'pages' , 'home.ngfactory.js' ) ;
113
116
114
117
const appModuleSet = new Set < string > ( ) ;
115
118
appModuleSet . add ( appModuleNgFactory ) ;
@@ -124,21 +127,21 @@ describe('treeshake', () => {
124
127
homeNgFactorySet . add ( appModuleNgFactory ) ;
125
128
126
129
const dependencyOneSet = new Set < string > ( ) ;
127
- dependencyOneSet . add ( index ) ;
130
+ dependencyOneSet . add ( ionicAngularEntryPoint ) ;
128
131
dependencyOneSet . add ( dependencyOneNgFactory ) ;
129
132
dependencyOneSet . add ( home ) ;
130
133
131
134
const dependencyOneNgFactorySet = new Set < string > ( ) ;
132
135
dependencyOneNgFactorySet . add ( homeNgFactory ) ;
133
136
134
137
const dependencyTwoSet = new Set < string > ( ) ;
135
- dependencyTwoSet . add ( index ) ;
138
+ dependencyTwoSet . add ( ionicAngularEntryPoint ) ;
136
139
137
140
const dependencyThreeSet = new Set < string > ( ) ;
138
- dependencyThreeSet . add ( index ) ;
141
+ dependencyThreeSet . add ( ionicAngularEntryPoint ) ;
139
142
140
143
const dependencyFourSet = new Set < string > ( ) ;
141
- dependencyFourSet . add ( index ) ;
144
+ dependencyFourSet . add ( ionicAngularEntryPoint ) ;
142
145
dependencyFourSet . add ( dependencyFourNgFactory ) ;
143
146
dependencyFourSet . add ( home ) ;
144
147
@@ -152,20 +155,20 @@ describe('treeshake', () => {
152
155
153
156
const dependencyOneHelperOneSet = new Set < string > ( ) ;
154
157
dependencyOneHelperOneSet . add ( dependencyOne ) ;
155
- dependencyOneHelperOneSet . add ( index ) ;
158
+ dependencyOneHelperOneSet . add ( ionicAngularEntryPoint ) ;
156
159
const dependencyOneHelperTwoSet = new Set < string > ( ) ;
157
160
dependencyOneHelperTwoSet . add ( dependencyOne ) ;
158
- dependencyOneHelperTwoSet . add ( index ) ;
161
+ dependencyOneHelperTwoSet . add ( ionicAngularEntryPoint ) ;
159
162
160
163
const alertSet = new Set < string > ( ) ;
161
164
alertSet . add ( alertController ) ;
162
165
163
166
const alertControllerSet = new Set < string > ( ) ;
164
- alertControllerSet . add ( index ) ;
167
+ alertControllerSet . add ( ionicAngularEntryPoint ) ;
165
168
alertControllerSet . add ( appModuleNgFactory ) ;
166
169
167
170
const alertComponentSet = new Set < string > ( ) ;
168
- alertComponentSet . add ( index ) ;
171
+ alertComponentSet . add ( ionicAngularEntryPoint ) ;
169
172
alertComponentSet . add ( alertComponentNgFactory ) ;
170
173
171
174
const alertComponentNgFactorySet = new Set < string > ( ) ;
@@ -175,12 +178,12 @@ describe('treeshake', () => {
175
178
actionSheetSet . add ( actionSheetController ) ;
176
179
177
180
const actionSheetControllerSet = new Set < string > ( ) ;
178
- actionSheetControllerSet . add ( index ) ;
181
+ actionSheetControllerSet . add ( ionicAngularEntryPoint ) ;
179
182
actionSheetControllerSet . add ( appModuleNgFactory ) ;
180
183
actionSheetControllerSet . add ( homeNgFactory ) ;
181
184
182
185
const actionSheetComponentSet = new Set < string > ( ) ;
183
- actionSheetComponentSet . add ( index ) ;
186
+ actionSheetComponentSet . add ( ionicAngularEntryPoint ) ;
184
187
actionSheetComponentSet . add ( actionSheetComponentNgFactory ) ;
185
188
186
189
const actionSheetComponentNgFactorySet = new Set < string > ( ) ;
@@ -199,7 +202,7 @@ describe('treeshake', () => {
199
202
dependencyMap . set ( dependencyThree , dependencyThreeSet ) ;
200
203
dependencyMap . set ( dependencyFour , dependencyFourSet ) ;
201
204
dependencyMap . set ( dependencyFourNgFactory , dependencyFourNgFactorySet ) ;
202
- dependencyMap . set ( index , indexSet ) ;
205
+ dependencyMap . set ( ionicAngularEntryPoint , indexSet ) ;
203
206
dependencyMap . set ( alert , alertSet ) ;
204
207
dependencyMap . set ( alertController , alertControllerSet ) ;
205
208
dependencyMap . set ( alertComponent , alertComponentSet ) ;
@@ -517,10 +520,10 @@ export { Transition } from './transitions/transition';
517
520
518
521
// act
519
522
520
- const modulesToPurge = [ '/Users/noone/myApp/node_modules/ionic-angular/components/ range/ range-knob',
521
- '/Users/noone/myApp/node_modules/ionic-angular/components/ refresher/ refresher',
522
- '/Users/noone/myApp/node_modules/ionic-angular/components/ refresher/ refresher-content'] ;
523
- const newContent = treeshake . purgeUnusedImportsAndExportsFromIndex ( '/Users/noone/myApp/node_modules/ionic-angular/index.js' , indexFileContent , modulesToPurge ) ;
523
+ const modulesToPurge = [ join ( componentDir , ' range' , ' range-knob') ,
524
+ join ( componentDir , ' refresher' , ' refresher') ,
525
+ join ( componentDir , ' refresher' , ' refresher-content') ] ;
526
+ const newContent = treeshake . purgeUnusedImportsAndExportsFromIndex ( ionicAngularEntryPoint , indexFileContent , modulesToPurge ) ;
524
527
525
528
// assert
526
529
expect ( newContent ) . not . toEqual ( indexFileContent ) ;
@@ -1203,9 +1206,9 @@ export const AppModuleNgFactory = new import0.NgModuleFactory(AppModuleInjector,
1203
1206
//# sourceMappingURL=app.module.ngfactory.js.map
1204
1207
` ;
1205
1208
1206
- const appModuleNgFactoryPath = `/Users/noone/Dev/myApp3/src/ app/ app.module.ngfactory.js` ;
1207
- const componentFactoryPath = `/Users/noone/Dev/myApp3/node_modules/ionic-angular/components/ action-sheet/ action-sheet-component.ngfactory.js` ;
1208
- const componentFactoryPath2 = `/Users/noone/Dev/myApp3/node_modules/ionic-angular/components/ alert/ alert-component.ngfactory.js` ;
1209
+ const appModuleNgFactoryPath = join ( srcDir , ' app' , ' app.module.ngfactory.js' ) ;
1210
+ const componentFactoryPath = join ( componentDir , ' action-sheet' , ' action-sheet-component.ngfactory.js' ) ;
1211
+ const componentFactoryPath2 = join ( componentDir , ' alert' , ' alert-component.ngfactory.js' ) ;
1209
1212
1210
1213
// act
1211
1214
const updatedContent = treeshake . purgeComponentNgFactoryImportAndUsage ( appModuleNgFactoryPath , knownContent , componentFactoryPath ) ;
@@ -1232,16 +1235,6 @@ export const AppModuleNgFactory = new import0.NgModuleFactory(AppModuleInjector,
1232
1235
} ) ;
1233
1236
1234
1237
describe ( 'purgeProviderControllerImportAndUsage' , ( ) => {
1235
- beforeEach ( ( ) => {
1236
- originalEnv = process . env ;
1237
- let env : any = { } ;
1238
- env [ Constants . ENV_VAR_IONIC_ANGULAR_DIR ] = join ( process . cwd ( ) , 'myApp' , 'node_modules' , 'ionic-angular' ) ;
1239
- process . env = env ;
1240
- } ) ;
1241
-
1242
- afterEach ( ( ) => {
1243
- process . env = originalEnv ;
1244
- } ) ;
1245
1238
1246
1239
it ( 'should purge the controller provider content' , ( ) => {
1247
1240
// arrange
@@ -1928,12 +1921,9 @@ export const AppModuleNgFactory = new import0.NgModuleFactory(AppModuleInjector,
1928
1921
//# sourceMappingURL=app.module.ngfactory.js.map
1929
1922
` ;
1930
1923
1931
- const baseDir = join ( process . cwd ( ) , 'myApp' ) ;
1932
- const nodeModulesPath = join ( baseDir , 'node_modules' ) ;
1933
-
1934
- const appModuleNgFactoryPath = join ( baseDir , 'src' , 'app' , 'app.module.ngfactory.js' ) ;
1935
- const controllerPath = join ( nodeModulesPath , 'ionic-angular' , 'components' , 'action-sheet' , 'action-sheet-controller.js' ) ;
1936
- const controllerPath2 = join ( nodeModulesPath , 'ionic-angular' , 'components' , 'alert' , 'alert-controller.js' ) ;
1924
+ const appModuleNgFactoryPath = join ( srcDir , 'app' , 'app.module.ngfactory.js' ) ;
1925
+ const controllerPath = join ( componentDir , 'action-sheet' , 'action-sheet-controller.js' ) ;
1926
+ const controllerPath2 = join ( componentDir , 'alert' , 'alert-controller.js' ) ;
1937
1927
1938
1928
// act
1939
1929
@@ -1942,8 +1932,8 @@ export const AppModuleNgFactory = new import0.NgModuleFactory(AppModuleInjector,
1942
1932
1943
1933
// assert
1944
1934
expect ( updatedContent ) . not . toEqual ( knownContent ) ;
1945
- const relativeImportPathOne = helpers . changeExtension ( relative ( nodeModulesPath , controllerPath ) , '' ) ;
1946
- const relativeImportPathTwo = helpers . changeExtension ( relative ( nodeModulesPath , controllerPath2 ) , '' ) ;
1935
+ const relativeImportPathOne = helpers . toUnixPath ( helpers . changeExtension ( relative ( nodeModulesDir , controllerPath ) , '' ) ) ;
1936
+ const relativeImportPathTwo = helpers . toUnixPath ( helpers . changeExtension ( relative ( nodeModulesDir , controllerPath2 ) , '' ) ) ;
1947
1937
1948
1938
const importRegexOne = treeshake . generateWildCardImportRegex ( relativeImportPathOne ) ;
1949
1939
const importRegexTwo = treeshake . generateWildCardImportRegex ( relativeImportPathTwo ) ;
0 commit comments