Skip to content

Commit

Permalink
test: Add single-file-only-test for deprecated libs in ui5.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
maxreichmann committed Apr 12, 2024
1 parent d680274 commit 02b4c69
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
11 changes: 11 additions & 0 deletions test/fixtures/linter/rules/NoDeprecatedApi/ui5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
specVersion: '3.0'
metadata:
name: com.ui5.troublesome.app
type: application
framework:
name: OpenUI5
version: "1.121.0"
libraries:
- name: sap.m
- name: sap.ui.core
- name: sap.landvisz
5 changes: 3 additions & 2 deletions test/lib/linter/_linterHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ export function createTestsForFixtures(fixturesPath: string) {
if (!fileName.endsWith(".js") &&
!fileName.endsWith(".xml") &&
!fileName.endsWith(".json") &&
!fileName.endsWith(".html")) {
// Ignore non-JavaScript, non-XML, non-JSON and non-HTML files
!fileName.endsWith(".html") &&
!fileName.endsWith(".yaml")) {
// Ignore non-JavaScript, non-XML, non-JSON, non-HTML and non-YAML files
continue;
}
let testName = fileName;
Expand Down
24 changes: 24 additions & 0 deletions test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1222,3 +1222,27 @@ Generated by [AVA](https://avajs.dev).
warningCount: 0,
},
]

## General: ui5.yaml

> Snapshot 1
[
{
coverageInfo: [],
errorCount: 1,
fatalErrorCount: 0,
filePath: 'ui5.yaml',
messages: [
{
column: 7,
fatal: undefined,
line: 11,
message: 'Use of deprecated library \'sap.landvisz\'',
ruleId: 'ui5-linter-no-deprecated-api',
severity: 2,
},
],
warningCount: 0,
},
]
Binary file modified test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.snap
Binary file not shown.

0 comments on commit 02b4c69

Please sign in to comment.