Skip to content

feat: add ui5 middleware code coverage #30

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ export default class extends Generator {
this.config.set("defaultTheme", "sap_fiori_3");
}

// set qunit coverage file
if (semver.gte(props.frameworkVersion, "1.113.0")) {
this.config.set("qunitCoverageFile", "qunit-coverage-istanbul.js");
} else {
this.config.set("qunitCoverageFile", "qunit-coverage.js");
}

// more relevant parameters
this.config.set("gte11150", semver.gte(props.frameworkVersion, "1.115.0"));
});
Expand Down
1 change: 1 addition & 0 deletions generators/app/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"@ui5/cli": "^3.3.4",
"@ui5/middleware-code-coverage": "^1.1.0",
"eslint": "^8.46.0",
"karma": "^6.4.2",
"karma-chrome-launcher": "^3.2.0",
Expand Down
2 changes: 2 additions & 0 deletions generators/app/templates/ui5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ server:
afterMiddleware: compression
- name: ui5-middleware-livereload
afterMiddleware: compression
- name: "@ui5/middleware-code-coverage"
afterMiddleware: compression
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<link rel="stylesheet" type="text/css" href="../../resources/sap/ui/thirdparty/qunit-2.css" />
<script src="../../resources/sap/ui/thirdparty/qunit-2.js"></script>
<script src="../../resources/sap/ui/qunit/qunit-junit.js"></script>
<script src="../../resources/sap/ui/qunit/<%= qunitCoverageFile %>" data-sap-ui-cover-only="<%= appURI %>/" data-sap-ui-cover-never="<%= appURI %>/test/"></script>
</head>
<body>
<div id="qunit"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<link rel="stylesheet" type="text/css" href="../../resources/sap/ui/thirdparty/qunit-2.css" />
<script src="../../resources/sap/ui/thirdparty/qunit-2.js"></script>
<script src="../../resources/sap/ui/qunit/qunit-junit.js"></script>
<script src="../../resources/sap/ui/qunit/qunit-coverage.js"></script>
<script src="../../resources/sap/ui/qunit/<%= qunitCoverageFile %>" data-sap-ui-cover-only="<%= appURI %>/" data-sap-ui-cover-never="<%= appURI %>/test/"></script>
<script src="../../resources/sap/ui/thirdparty/sinon.js"></script>
<script src="../../resources/sap/ui/thirdparty/sinon-qunit.js"></script>
</head>
Expand Down