2017-02-22 15:25:57 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<!--
|
|
|
|
Tests for browser.
|
|
|
|
Open this file in browser via web server.
|
|
|
|
|
|
|
|
Tun run tests in node run "node test".
|
|
|
|
|
|
|
|
Before opening this file you need to compile tests.
|
|
|
|
To compile tests run "node build/tests".
|
|
|
|
|
|
|
|
Important: this file should be ran from web server, not file://
|
|
|
|
-->
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
|
|
|
<meta name="viewport" content="width=1024px">
|
|
|
|
<!--[if IE]>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20150312/classList.min.js"></script>
|
|
|
|
<![endif]-->
|
|
|
|
<title>Tests</title>
|
|
|
|
<link href="./node_modules/mocha/mocha.css" rel="stylesheet" />
|
|
|
|
<style>
|
|
|
|
#debug, #debug2 { display: none }
|
|
|
|
|
|
|
|
#log {
|
|
|
|
font: 11px / 15px sans-serif;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="mocha"></div>
|
|
|
|
<div id="debug"></div>
|
|
|
|
<div id="debug2"></div>
|
|
|
|
<div id="log"></div>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
|
|
|
<script src="https://cdn.rawgit.com/Automattic/expect.js/0.3.1/index.js"></script>
|
|
|
|
<script src="./node_modules/mocha/mocha.js"></script>
|
|
|
|
<script src="./node_modules/chai/chai.js"></script>
|
|
|
|
<script>mocha.setup('bdd');</script>
|
|
|
|
|
|
|
|
<script src="./debug/tests.js"></script>
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
mocha.checkLeaks();
|
|
|
|
mocha.setup({
|
|
|
|
globals: ['SSVGLoaderTest1', 'SSVGRenderTest', 'SSVGRenderTest2']
|
|
|
|
});
|
|
|
|
mocha.run();
|
|
|
|
});
|
|
|
|
|
2017-04-06 17:11:26 +00:00
|
|
|
(function() {
|
|
|
|
var oldLog = console.log;
|
2017-02-22 15:25:57 +00:00
|
|
|
|
2017-04-06 17:11:26 +00:00
|
|
|
console.log = function() {
|
|
|
|
oldLog.apply(this, arguments);
|
|
|
|
|
|
|
|
var html = '';
|
|
|
|
for (var i = 0; i < arguments.length; i ++) {
|
|
|
|
switch (typeof arguments[i]) {
|
|
|
|
case 'string':
|
|
|
|
case 'number':
|
|
|
|
case 'function':
|
|
|
|
html += ' ' + arguments[i];
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
html += ' ' + JSON.stringify(arguments[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$('#log').append($('<p />').text(html));
|
|
|
|
};
|
|
|
|
|
|
|
|
})();
|
2017-02-22 15:25:57 +00:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|