Skip to content

Commit 2387e73

Browse files
author
Shailesh M. Pachbhai
committed
feat: fix unit test
1 parent bb6567a commit 2387e73

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

src/migration/related/LwcMigration.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ export class LwcMigration extends BaseRelatedObjectMigration implements RelatedO
7171
const path = file.location;
7272
const name = file.name + file.ext;
7373
if (file.ext === 'xml') {
74-
// if (fileutil.isAutogenratedFile(path)) {
75-
76-
// }
74+
// if (fileutil.isAutogenratedFile(path)) { }
7775
}
7876
const diff = processor.process(file, type, this.namespace);
7977
if (diff != null) {

src/utils/lwcparser/htmlParser/HTMLParser.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/* eslint-disable @typescript-eslint/no-unsafe-return */
2+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
3+
/* eslint-disable @typescript-eslint/no-unsafe-call */
4+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
5+
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
6+
/* eslint-disable @typescript-eslint/restrict-template-expressions */
7+
/* eslint-disable @typescript-eslint/member-ordering */
8+
/* eslint-disable no-console */
19
import * as fs from 'fs';
210
import { FileConstant } from '../fileutils/FileConstant';
311

@@ -23,12 +31,15 @@ export class HTMLParser {
2331

2432
// Method to replace custom tags
2533
public replaceTags(namespaceTag: string): Map<string, string> {
26-
const htmlContentMap = new Map<string, string>();
27-
htmlContentMap.set(FileConstant.BASE_CONTENT, this.html);
28-
// Use a regular expression to match <omnistudio-input ...>...</omnistudio-input>
29-
this.html = this.html.replace('<'+namespaceTag, '<'+DEFAULT_NAMESPACE).replace('</'+namespaceTag, '</'+DEFAULT_NAMESPACE);
30-
htmlContentMap.set(FileConstant.MODIFIED_CONTENT, this.html);
31-
console.log(this.html);
34+
const htmlContentMap = new Map<string, string>();
35+
htmlContentMap.set(FileConstant.BASE_CONTENT, this.html);
36+
// Use a regular expression to match <omnistudio-input> to </omnistudio-input>
37+
38+
this.html = this.html
39+
.replace('<' + namespaceTag, '<' + DEFAULT_NAMESPACE)
40+
.replace('</' + namespaceTag, '</' + DEFAULT_NAMESPACE);
41+
42+
htmlContentMap.set(FileConstant.MODIFIED_CONTENT, this.html);
3243
return htmlContentMap;
3344
}
3445

0 commit comments

Comments
 (0)