signal-desktop/test/index.html
2023-01-03 11:55:46 -08:00

63 lines
1.7 KiB
HTML

<!-- Copyright 2014 Signal Messenger, LLC -->
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
<html>
<head>
<meta charset="utf-8" />
<title>TextSecure test runner</title>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
<link rel="stylesheet" href="../stylesheets/manifest.css" />
</head>
<body>
<div id="mocha"></div>
<div id="tests"></div>
<script type="text/javascript" src="../js/components.js"></script>
<script
type="text/javascript"
src="../ts/backbone/reliable_trigger.js"
></script>
<script
type="text/javascript"
src="../node_modules/mocha/mocha.js"
></script>
<script type="text/javascript">
mocha.setup('bdd');
</script>
<script type="text/javascript" src="test.js"></script>
<script type="text/javascript">
window.Signal.conversationControllerStart();
window.testUtilities.prepareTests();
delete window.testUtilities.prepareTests;
!(function () {
const passed = [];
const failed = [];
class Reporter extends Mocha.reporters.HTML {
constructor(runner, options) {
super(runner, options);
runner.on('pass', test => passed.push(test.fullTitle()));
runner.on('fail', (test, error) => {
failed.push({
testName: test.fullTitle(),
error: error?.stack || String(error),
});
});
runner.on('end', () =>
window.testUtilities.onComplete({ passed, failed })
);
}
}
mocha.reporter(Reporter);
mocha.run();
})();
</script>
</body>
</html>