-
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.
[FIX] TypeError: top.jsUnitTestSuite is not a constructor
Testsuites might be using top.jsUnitTestSuite to get the testsuite class. Therefore both it should be available in "parent" and "top".
- Loading branch information
Showing
15 changed files
with
145 additions
and
0 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
20 changes: 20 additions & 0 deletions
20
test/integration/library-ui5-tooling-multiple-testsuites/karma.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,20 @@ | ||
module.exports = function(config) { | ||
"use strict"; | ||
|
||
require("../karma-base.conf")(config); | ||
config.set({ | ||
|
||
frameworks: ["ui5"], | ||
|
||
ui5: { | ||
testpage: "test/sap/test/lib/qunit/testsuite.qunit.html" | ||
}, | ||
|
||
plugins: [ | ||
require("../../../lib"), | ||
require("karma-chrome-launcher") | ||
], | ||
|
||
|
||
}); | ||
}; |
7 changes: 7 additions & 0 deletions
7
test/integration/library-ui5-tooling-multiple-testsuites/package.json
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,7 @@ | ||
{ | ||
"name": "library-ui5-tooling-multiple-testsuites", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"@openui5/sap.ui.core": "*" | ||
} | ||
} |
Empty file.
13 changes: 13 additions & 0 deletions
13
test/integration/library-ui5-tooling-multiple-testsuites/src/sap/test/lib/library.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,13 @@ | ||
sap.ui.define(["sap/ui/core/library"], function() { | ||
"use strict"; | ||
|
||
sap.ui.getCore().initLibrary({ | ||
name: "sap.test.lib", | ||
dependencies: ["sap.ui.core"], | ||
controls: [], | ||
elements: [], | ||
noLibraryCSS: true | ||
}); | ||
|
||
return sap.test.lib; | ||
}); |
1 change: 1 addition & 0 deletions
1
test/integration/library-ui5-tooling-multiple-testsuites/test/.dotfile
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 @@ | ||
dotfile |
15 changes: 15 additions & 0 deletions
15
...ation/library-ui5-tooling-multiple-testsuites/test/sap/test/lib/qunit/foo/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,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>QUnit Test</title> | ||
|
||
<script id="sap-ui-bootstrap" src="../../../../../../resources/sap-ui-core.js" data-sap-ui-libs="sap.test.lib"></script> | ||
<link rel="stylesheet" href="../../../../../../resources/sap/ui/thirdparty/qunit-2.css"> | ||
<script src="../../../../../../resources/sap/ui/thirdparty/qunit-2.js"></script> | ||
<script src="../test.qunit.js"></script> <!-- just run the same test --> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
</body> | ||
</html> |
15 changes: 15 additions & 0 deletions
15
...tegration/library-ui5-tooling-multiple-testsuites/test/sap/test/lib/qunit/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,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>QUnit Test</title> | ||
|
||
<script id="sap-ui-bootstrap" src="../../../../../resources/sap-ui-core.js" data-sap-ui-libs="sap.test.lib"></script> | ||
<link rel="stylesheet" href="../../../../../resources/sap/ui/thirdparty/qunit-2.css"> | ||
<script src="../../../../../resources/sap/ui/thirdparty/qunit-2.js"></script> | ||
<script src="./test.qunit.js"></script> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
</body> | ||
</html> |
18 changes: 18 additions & 0 deletions
18
...integration/library-ui5-tooling-multiple-testsuites/test/sap/test/lib/qunit/test.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,18 @@ | ||
/* global QUnit */ | ||
|
||
QUnit.config.autostart = false; | ||
|
||
sap.ui.getCore().attachInit(function() { | ||
"use strict"; | ||
|
||
QUnit.test("Karma", function(assert) { | ||
assert.ok(parent.__karma__.files["/base/src/sap/test/lib/.library"], "Karma src files should contain dotfiles"); | ||
assert.ok(parent.__karma__.files["/base/test/.dotfile"], "Karma test files should contain dotfiles"); | ||
}); | ||
|
||
QUnit.test("sap.test.lib", function(assert) { | ||
assert.ok(sap.ui.getCore().getLoadedLibraries()["sap.test.lib"], "Library has been loaded"); | ||
}); | ||
|
||
QUnit.start(); | ||
}); |
10 changes: 10 additions & 0 deletions
10
.../library-ui5-tooling-multiple-testsuites/test/sap/test/lib/qunit/testsuite.foo.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,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Testsuite</title> | ||
<script src="../../../../../resources/sap/ui/qunit/qunit-redirect.js"></script> | ||
<script src="testsuite.foo.qunit.js" data-sap-ui-testsuite></script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
13 changes: 13 additions & 0 deletions
13
...on/library-ui5-tooling-multiple-testsuites/test/sap/test/lib/qunit/testsuite.foo.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,13 @@ | ||
/* global window, top, location */ | ||
|
||
// eslint-disable-next-line sap-no-global-define | ||
window.suite = function() { | ||
"use strict"; | ||
|
||
// eslint-disable-next-line | ||
var oSuite = new top.jsUnitTestSuite(), | ||
sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf("/") + 1); | ||
oSuite.addTestPage(sContextPath + "foo/test.qunit.html"); | ||
|
||
return oSuite; | ||
}; |
10 changes: 10 additions & 0 deletions
10
...tion/library-ui5-tooling-multiple-testsuites/test/sap/test/lib/qunit/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,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Testsuite</title> | ||
<script src="../../../../../resources/sap/ui/qunit/qunit-redirect.js"></script> | ||
<script src="testsuite.qunit.js" data-sap-ui-testsuite></script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
14 changes: 14 additions & 0 deletions
14
...ration/library-ui5-tooling-multiple-testsuites/test/sap/test/lib/qunit/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,14 @@ | ||
/* global window, top, location */ | ||
|
||
// eslint-disable-next-line sap-no-global-define | ||
window.suite = function() { | ||
"use strict"; | ||
|
||
// eslint-disable-next-line | ||
var oSuite = new top.jsUnitTestSuite(), | ||
sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf("/") + 1); | ||
oSuite.addTestPage(sContextPath + "test.qunit.html"); | ||
oSuite.addTestPage(sContextPath + "testsuite.foo.qunit.html"); | ||
|
||
return oSuite; | ||
}; |
5 changes: 5 additions & 0 deletions
5
test/integration/library-ui5-tooling-multiple-testsuites/ui5.yaml
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,5 @@ | ||
--- | ||
specVersion: "0.1" | ||
type: library | ||
metadata: | ||
name: sap.x |