-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Add "failOnEmptyTestPage" option (#228)
Fixes: #226 Co-authored-by: Matthias Osswald <mat.osswald@sap.com>
- Loading branch information
Showing
12 changed files
with
291 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ntegration/application-ui5-tooling-error-handling/karma-failOnEmptyTestPage-false.conf.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module.exports = function(config) { | ||
"use strict"; | ||
|
||
require("../karma-base.conf")(config); | ||
config.set({ | ||
|
||
frameworks: ["ui5"], | ||
|
||
ui5: { | ||
failOnEmptyTestPage: false, | ||
testpage: "webapp/test/empty-testpage/testsuite.qunit.html" | ||
} | ||
|
||
}); | ||
|
||
require("../saucelabs").setTestName(config, __filename); | ||
}; | ||
|
||
module.exports.shouldFail = false; | ||
module.exports.assertions = ({expect, log}) => { | ||
expect(log).toMatch(/Executed 1 of 1/); | ||
expect(log).toMatch(/TOTAL: 1 SUCCESS/); | ||
expect(log).toMatch(/Testpage "\/base\/webapp\/test\/empty-testpage\/empty.qunit.html" did not define any tests/); | ||
expect(log).toMatch(/Please consider enabling the "failOnEmptyTestPage" option/); | ||
}; |
25 changes: 25 additions & 0 deletions
25
...integration/application-ui5-tooling-error-handling/karma-failOnEmptyTestPage-true.conf.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module.exports = function(config) { | ||
"use strict"; | ||
|
||
require("../karma-base.conf")(config); | ||
config.set({ | ||
|
||
frameworks: ["ui5"], | ||
|
||
ui5: { | ||
failOnEmptyTestPage: true, | ||
testpage: "webapp/test/empty-testpage/testsuite.qunit.html" | ||
} | ||
|
||
}); | ||
|
||
require("../saucelabs").setTestName(config, __filename); | ||
}; | ||
|
||
module.exports.shouldFail = true; | ||
module.exports.assertions = ({expect, log}) => { | ||
expect(log).toMatch(/Executed 2 of 2/); | ||
expect(log).toMatch(/TOTAL: 1 FAILED, 1 SUCCESS/); | ||
expect(log).toMatch(/\/base\/webapp\/test\/empty-testpage\/empty.qunit.html FAILED/); | ||
expect(log).toMatch(/Testpage did not define any tests./); | ||
}; |
23 changes: 23 additions & 0 deletions
23
...application-ui5-tooling-error-handling/karma-failOnEmptyTestPage-with-script-mode.conf.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = function(config) { | ||
"use strict"; | ||
|
||
require("../karma-base.conf")(config); | ||
config.set({ | ||
|
||
frameworks: ["ui5"], | ||
|
||
ui5: { | ||
mode: "script", | ||
// Can only be used in html mode | ||
failOnEmptyTestPage: true | ||
} | ||
|
||
}); | ||
|
||
require("../saucelabs").setTestName(config, __filename); | ||
}; | ||
|
||
module.exports.shouldFail = true; | ||
module.exports.assertions = ({expect, log}) => { | ||
expect(log).toMatch(/The failOnEmptyTestPage configuration can only be used in "html" mode/); | ||
}; |
17 changes: 17 additions & 0 deletions
17
...ration/application-ui5-tooling-error-handling/webapp/test/empty-testpage/empty.qunit.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>QUnit Test</title> | ||
|
||
<script id="sap-ui-bootstrap" src="../../resources/sap-ui-core.js"></script> | ||
<link rel="stylesheet" href="../../resources/sap/ui/thirdparty/qunit-2.css"> | ||
<script src="../../resources/sap/ui/thirdparty/qunit-2.js"></script> | ||
<script> | ||
// No tests defined | ||
</script> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
</body> | ||
</html> |
19 changes: 19 additions & 0 deletions
19
...gration/application-ui5-tooling-error-handling/webapp/test/empty-testpage/test.qunit.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>QUnit Test</title> | ||
|
||
<script id="sap-ui-bootstrap" src="../../resources/sap-ui-core.js"></script> | ||
<link rel="stylesheet" href="../../resources/sap/ui/thirdparty/qunit-2.css"> | ||
<script src="../../resources/sap/ui/thirdparty/qunit-2.js"></script> | ||
<script> | ||
QUnit.test("Dummy", function(assert) { | ||
assert.ok(true); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
</body> | ||
</html> |
9 changes: 9 additions & 0 deletions
9
...on/application-ui5-tooling-error-handling/webapp/test/empty-testpage/testsuite.qunit.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Testsuite</title> | ||
<script src="testsuite.qunit.js" data-sap-ui-testsuite></script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
11 changes: 11 additions & 0 deletions
11
...tion/application-ui5-tooling-error-handling/webapp/test/empty-testpage/testsuite.qunit.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
window.suite = function() { | ||
"use strict"; | ||
|
||
// eslint-disable-next-line new-cap | ||
const oSuite = new parent.jsUnitTestSuite(); | ||
const sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf("/") + 1); | ||
oSuite.addTestPage(sContextPath + "test.qunit.html"); | ||
oSuite.addTestPage(sContextPath + "empty.qunit.html"); | ||
|
||
return oSuite; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters