Skip to content

Commit

Permalink
test: Stabilize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Feb 6, 2025
1 parent 99e61ea commit be38fa1
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 42 deletions.
7 changes: 6 additions & 1 deletion test/lib/linter/xmlInJs/_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ export function createTestsForFixtures(fixturesPath: string) {
coverage: true,
details: true,
});

extractedResource?.forEach((resource) => t.snapshot(resource.xmlSnippet));
resources.forEach((res) => t.snapshot(res));
resources.forEach((res) => {
res.messages.sort(
(a, b) => (a.line! - b.line!) + (a.column! - b.column!));
t.snapshot(res);
});
});
}
} catch (err) {
Expand Down
82 changes: 41 additions & 41 deletions test/lib/linter/xmlInJs/snapshots/transpiler.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ Generated by [AVA](https://avajs.dev).
ruleId: 'no-deprecated-api',
severity: 2,
},
{
column: 19,
line: 2,
message: 'Access of global variable \'sap\' (sap.ui.fragment)',
messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)',
ruleId: 'no-globals',
severity: 2,
},
{
column: 12,
line: 15,
Expand All @@ -103,9 +111,9 @@ Generated by [AVA](https://avajs.dev).
severity: 2,
},
{
column: 19,
line: 2,
message: 'Access of global variable \'sap\' (sap.ui.fragment)',
column: 20,
line: 11,
message: 'Access of global variable \'sap\' (sap.ui.xmlfragment)',
messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)',
ruleId: 'no-globals',
severity: 2,
Expand All @@ -118,14 +126,6 @@ Generated by [AVA](https://avajs.dev).
ruleId: 'no-deprecated-api',
severity: 2,
},
{
column: 20,
line: 11,
message: 'Access of global variable \'sap\' (sap.ui.xmlfragment)',
messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)',
ruleId: 'no-globals',
severity: 2,
},
],
warningCount: 0,
}
Expand Down Expand Up @@ -192,19 +192,11 @@ Generated by [AVA](https://avajs.dev).
filePath: 'resources/namespace/SapUIView.js',
messages: [
{
column: 13,
line: 23,
message: 'Use of deprecated property \'tap\' of class \'Button\'',
messageDetails: '(since 1.20) - replaced by `press` event',
ruleId: 'no-deprecated-api',
severity: 2,
},
{
column: 13,
line: 35,
message: 'Use of deprecated property \'tap\' of class \'Button\'',
messageDetails: '(since 1.20) - replaced by `press` event',
ruleId: 'no-deprecated-api',
column: 16,
line: 2,
message: 'Access of global variable \'sap\' (sap.ui.view)',
messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)',
ruleId: 'no-globals',
severity: 2,
},
{
Expand All @@ -225,22 +217,13 @@ Generated by [AVA](https://avajs.dev).
severity: 2,
},
{
column: 16,
line: 2,
message: 'Access of global variable \'sap\' (sap.ui.view)',
column: 2,
line: 28,
message: 'Access of global variable \'sap\' (sap.ui.xmlview)',
messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)',
ruleId: 'no-globals',
severity: 2,
},
{
column: 24,
line: 15,
message: 'Call to deprecated function \'view\' (sap.ui.view)',
messageDetails: `(since 1.56) - Use View.extend (https://ui5.sap.com/1.120/#/api/sap.ui.core.mvc.View%23methods/sap.ui.core.mvc.View.extend) to define the view class␊
and View.create (https://ui5.sap.com/1.120/#/api/sap.ui.core.mvc.View) to create view instances`,
ruleId: 'no-deprecated-api',
severity: 2,
},
{
column: 17,
line: 15,
Expand All @@ -249,6 +232,14 @@ Generated by [AVA](https://avajs.dev).
ruleId: 'no-globals',
severity: 2,
},
{
column: 13,
line: 23,
message: 'Use of deprecated property \'tap\' of class \'Button\'',
messageDetails: '(since 1.20) - replaced by `press` event',
ruleId: 'no-deprecated-api',
severity: 2,
},
{
column: 9,
line: 28,
Expand All @@ -258,11 +249,20 @@ Generated by [AVA](https://avajs.dev).
severity: 2,
},
{
column: 2,
line: 28,
message: 'Access of global variable \'sap\' (sap.ui.xmlview)',
messageDetails: 'Do not use global variables to access UI5 modules or APIs. See Best Practices for Developers (https://ui5.sap.com/#/topic/28fcd55b04654977b63dacbee0552712)',
ruleId: 'no-globals',
column: 24,
line: 15,
message: 'Call to deprecated function \'view\' (sap.ui.view)',
messageDetails: `(since 1.56) - Use View.extend (https://ui5.sap.com/1.120/#/api/sap.ui.core.mvc.View%23methods/sap.ui.core.mvc.View.extend) to define the view class␊
and View.create (https://ui5.sap.com/1.120/#/api/sap.ui.core.mvc.View) to create view instances`,
ruleId: 'no-deprecated-api',
severity: 2,
},
{
column: 13,
line: 35,
message: 'Use of deprecated property \'tap\' of class \'Button\'',
messageDetails: '(since 1.20) - replaced by `press` event',
ruleId: 'no-deprecated-api',
severity: 2,
},
],
Expand Down
Binary file modified test/lib/linter/xmlInJs/snapshots/transpiler.ts.snap
Binary file not shown.

0 comments on commit be38fa1

Please sign in to comment.