Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add test-case for project type "module" #148

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/fixtures/linter/projects/module/foo/Example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sap.ui.getCore().attachInit(() => {});
4 changes: 4 additions & 0 deletions test/fixtures/linter/projects/module/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "test.module",
"version": "1.0.0"
}
9 changes: 9 additions & 0 deletions test/fixtures/linter/projects/module/ui5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
specVersion: "3.2"
type: module
metadata:
name: test.module

resources:
configuration:
paths:
/module/foo/: ./foo/
18 changes: 18 additions & 0 deletions test/lib/linter/linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,21 @@ test.serial("lint: All files of library with sap.f namespace", async (t) => {

t.snapshot(preprocessLintResultsForSnapshot(res));
});

test.serial("lint: All files of module project", async (t) => {
const projectPath = path.join(fixturesProjectsPath, "module");
const {lintProject} = t.context;

let res = await lintProject({
rootDir: projectPath,
pathsToLint: [],
reportCoverage: true,
includeMessageDetails: true,
});

res = res.sort((a: {filePath: string}, b: {filePath: string}) => {
return a.filePath.localeCompare(b.filePath);
});

t.snapshot(preprocessLintResultsForSnapshot(res));
});
Loading