Skip to content

Commit

Permalink
fix: Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Mar 26, 2024
1 parent 7414d89 commit 8947126
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 116 deletions.
2 changes: 1 addition & 1 deletion src/detectors/typeChecker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export class TsFileDetector extends FileBasedDetector {
if (!fileContent) {
throw new Error(`Failed to read file ${filePath}`);
}
internalfilePath = filePath.replace(/\.html$/, ".html.js");
internalfilePath = filePath.replace(/\.html$/, ".js");
transformationResult = await lintHtml(internalfilePath, fs.createReadStream(filePath));
transformationResult.source = fileContent;
} else {
Expand Down
118 changes: 3 additions & 115 deletions test/lib/linter/snapshots/linter.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,35 +581,8 @@ Generated by [AVA](https://avajs.dev).
coverageInfo: [],
errorCount: 0,
fatalErrorCount: 0,
filePath: 'webapp/test/integration/opaTests.qunit.html',
messages: [],
warningCount: 0,
},
{
coverageInfo: [],
errorCount: 2,
fatalErrorCount: 0,
filePath: 'webapp/test/integration/opaTests.qunit.js',
messages: [
{
column: 1,
fatal: undefined,
line: 4,
message: 'Call to deprecated function \'attachInit\' of class \'Core\'',
messageDetails: 'Deprecated test message',
ruleId: 'ui5-linter-no-deprecated-api',
severity: 2,
},
{
column: 1,
fatal: undefined,
line: 4,
message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)',
messageDetails: 'Deprecated test message',
ruleId: 'ui5-linter-no-deprecated-api',
severity: 2,
},
],
messages: [],
warningCount: 0,
},
{
Expand Down Expand Up @@ -675,27 +648,6 @@ Generated by [AVA](https://avajs.dev).
coverageInfo: [],
errorCount: 0,
fatalErrorCount: 0,
filePath: 'webapp/test/testsuite.qunit.html',
messages: [],
warningCount: 0,
},
{
coverageInfo: [
{
category: 1,
column: 2,
line: 6,
message: 'Unable to analyze this method call because the type of identifier "addTestPage" in "suite.addTestPage(sContextPath + "unit/unitTests.qunit.html")"" could not be determined',
},
{
category: 1,
column: 2,
line: 7,
message: 'Unable to analyze this method call because the type of identifier "addTestPage" in "suite.addTestPage(sContextPath + "integration/opaTests.qunit.html")"" could not be determined',
},
],
errorCount: 0,
fatalErrorCount: 0,
filePath: 'webapp/test/testsuite.qunit.js',
messages: [],
warningCount: 0,
Expand All @@ -712,35 +664,8 @@ Generated by [AVA](https://avajs.dev).
coverageInfo: [],
errorCount: 0,
fatalErrorCount: 0,
filePath: 'webapp/test/unit/unitTests.qunit.html',
messages: [],
warningCount: 0,
},
{
coverageInfo: [],
errorCount: 2,
fatalErrorCount: 0,
filePath: 'webapp/test/unit/unitTests.qunit.js',
messages: [
{
column: 1,
fatal: undefined,
line: 6,
message: 'Call to deprecated function \'attachInit\' of class \'Core\'',
messageDetails: 'Deprecated test message',
ruleId: 'ui5-linter-no-deprecated-api',
severity: 2,
},
{
column: 1,
fatal: undefined,
line: 6,
message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)',
messageDetails: 'Deprecated test message',
ruleId: 'ui5-linter-no-deprecated-api',
severity: 2,
},
],
messages: [],
warningCount: 0,
},
{
Expand Down Expand Up @@ -987,45 +912,8 @@ Generated by [AVA](https://avajs.dev).
coverageInfo: [],
errorCount: 0,
fatalErrorCount: 0,
filePath: 'src/test/js/Example.html',
messages: [],
warningCount: 0,
},
{
coverageInfo: [
{
category: 1,
column: 2,
line: 9,
message: `Unable to analyze this method call because the type of identifier "placeAt" in "new Example({␊
text: "Example",␊
color: ExampleColor.Highlight,␊
press: function (event) {␊
alert(event.getSource());␊
}␊
}).placeAt("content")"" could not be determined`,
},
{
category: 1,
column: 10,
line: 13,
message: 'Unable to analyze this method call because the type of identifier "getSource" in "event.getSource()"" could not be determined',
},
],
errorCount: 1,
fatalErrorCount: 0,
filePath: 'src/test/js/Example.js',
messages: [
{
column: 90,
fatal: undefined,
line: 1,
message: 'Import of deprecated module \'sap/ui/model/odata/ODataModel\'',
messageDetails: 'Deprecated test message',
ruleId: 'ui5-linter-no-deprecated-api',
severity: 2,
},
],
messages: [],
warningCount: 0,
},
]
Expand Down
Binary file modified test/lib/linter/snapshots/linter.ts.snap
Binary file not shown.

0 comments on commit 8947126

Please sign in to comment.