103 lines
3.8 KiB
HTML
103 lines
3.8 KiB
HTML
<!DOCTYPE html>
|
|
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Loop shared mocha tests</title>
|
|
<link rel="stylesheet" media="all" href="vendor/mocha-2.2.5.css">
|
|
</head>
|
|
<body>
|
|
<div id="mocha">
|
|
<p><a href="../">Index</a></p>
|
|
</div>
|
|
<div id="messages"></div>
|
|
<div id="fixtures"></div>
|
|
<script>
|
|
var uncaughtError;
|
|
window.addEventListener("error", function(error) {
|
|
uncaughtError = error;
|
|
});
|
|
var consoleWarn = console.warn;
|
|
var caughtWarnings = [];
|
|
console.warn = function() {
|
|
var args = Array.slice(arguments);
|
|
caughtWarnings.push(args);
|
|
consoleWarn.apply(console, args);
|
|
};
|
|
</script>
|
|
|
|
<!-- libs -->
|
|
<script src="../../content/shared/libs/react-0.12.2.js"></script>
|
|
<script src="../../content/shared/libs/lodash-3.9.3.js"></script>
|
|
<script src="../../content/shared/libs/backbone-1.2.1.js"></script>
|
|
<script src="../../standalone/content/libs/l10n-gaia-02ca67948fe8.js"></script>
|
|
|
|
<!-- test dependencies -->
|
|
<script src="vendor/mocha-2.2.5.js"></script>
|
|
<script src="vendor/chai-3.0.0.js"></script>
|
|
<script src="vendor/chai-as-promised-5.1.0.js"></script>
|
|
<script src="vendor/sinon-1.16.1.js"></script>
|
|
<script>
|
|
/*global chai, mocha */
|
|
chai.config.includeStack = true;
|
|
mocha.setup({ui: 'bdd', timeout: 10000});
|
|
</script>
|
|
|
|
<!-- App scripts -->
|
|
<script src="../../content/shared/js/utils.js"></script>
|
|
<script src="../../content/shared/js/models.js"></script>
|
|
<script src="../../content/shared/js/mixins.js"></script>
|
|
<script src="../../content/shared/js/crypto.js"></script>
|
|
<script src="../../content/shared/js/validate.js"></script>
|
|
<script src="../../content/shared/js/actions.js"></script>
|
|
<script src="../../content/shared/js/dispatcher.js"></script>
|
|
<script src="../../content/shared/js/otSdkDriver.js"></script>
|
|
<script src="../../content/shared/js/store.js"></script>
|
|
<script src="../../content/shared/js/roomStates.js"></script>
|
|
<script src="../../content/shared/js/activeRoomStore.js"></script>
|
|
<script src="../../content/shared/js/views.js"></script>
|
|
<script src="../../content/shared/js/textChatStore.js"></script>
|
|
<script src="../../content/shared/js/textChatView.js"></script>
|
|
<script src="../../content/shared/js/urlRegExps.js"></script>
|
|
<script src="../../content/shared/js/linkifiedTextView.js"></script>
|
|
|
|
<!-- Test scripts -->
|
|
<script src="models_test.js"></script>
|
|
<script src="mixins_test.js"></script>
|
|
<script src="utils_test.js"></script>
|
|
<script src="crypto_test.js"></script>
|
|
<script src="views_test.js"></script>
|
|
<script src="validate_test.js"></script>
|
|
<script src="dispatcher_test.js"></script>
|
|
<script src="activeRoomStore_test.js"></script>
|
|
<script src="otSdkDriver_test.js"></script>
|
|
<script src="store_test.js"></script>
|
|
<script src="textChatStore_test.js"></script>
|
|
<script src="textChatView_test.js"></script>
|
|
<script src="linkifiedTextView_test.js"></script>
|
|
|
|
<script>
|
|
describe("Uncaught Error Check", function() {
|
|
it("should load the tests without errors", function() {
|
|
chai.expect(uncaughtError && uncaughtError.message).to.be.undefined;
|
|
});
|
|
});
|
|
|
|
describe("Unexpected Warnings Check", function() {
|
|
it("should long only the warnings we expect", function() {
|
|
chai.expect(caughtWarnings.length).to.eql(0);
|
|
});
|
|
});
|
|
|
|
mocha.run(function () {
|
|
var completeNode = document.createElement("p");
|
|
completeNode.setAttribute("id", "complete");
|
|
completeNode.appendChild(document.createTextNode("Complete"));
|
|
document.getElementById("mocha").appendChild(completeNode);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|