File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
projects/igniteui-angular/migrations/common Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ describe('UpdateChanges', () => {
182
182
} ) ;
183
183
spyOn < any > ( fs , 'readFileSync' ) . and . callFake ( ( ) => JSON . stringify ( inputJson ) ) ;
184
184
185
- const fileContent = `<one [replaceMe]="a"> <comp\r\ntag [replaceMe]="dwdw" [oldProp]=''> </other> <another oldProp="b" />` ;
185
+ let fileContent = `<one [replaceMe]="a"> <comp\r\ntag [replaceMe]="dwdw" [oldProp]=''> </other> <another oldProp="b" />` ;
186
186
appTree . create ( 'test.component.html' , fileContent ) ;
187
187
188
188
const update = new UnitUpdateChanges ( __dirname , appTree ) ;
@@ -220,6 +220,15 @@ describe('UpdateChanges', () => {
220
220
update4 . applyChanges ( ) ;
221
221
expect ( appTree . readContent ( 'test.component.html' ) ) . toEqual (
222
222
`<comp\r\ntag [oldProp]="g" [replaced]="NOT.replaceMe" ><another [otherProp]="oldProp" /></comp>` ) ;
223
+
224
+
225
+ fileContent = `<span [bait]="replaceMe"><ng-container ngProjectAs="comp"> sike! </ng-container></span>` ;
226
+ appTree . overwrite ( 'test.component.html' , fileContent ) ;
227
+ update4 . applyChanges ( ) ;
228
+ expect ( appTree . readContent ( 'test.component.html' ) ) . toEqual (
229
+ `<span [bait]="replaceMe"><ng-container ngProjectAs="comp"> sike! </ng-container></span>`
230
+ ) ;
231
+
223
232
done ( ) ;
224
233
} ) ;
225
234
Original file line number Diff line number Diff line change @@ -276,6 +276,9 @@ export class UpdateChanges {
276
276
}
277
277
278
278
const matches = fileContent . match ( new RegExp ( searchPattern , 'g' ) ) ;
279
+ if ( ! matches ) {
280
+ continue ;
281
+ }
279
282
280
283
for ( const match of matches ) {
281
284
let replaceStatement = replace ;
You can’t perform that action at this time.
0 commit comments