konva/test/unit-tests.html
2021-05-03 21:21:04 -05:00

101 lines
2.9 KiB
HTML

<html>
<body>
<div id="mocha"></div>
<!-- use mocha from CDN instead of local node_modules -->
<!-- because somehow parcel is failing do build mocha correctly -->
<link rel="stylesheet" href="https://unpkg.com/mocha/mocha.css" />
<script src="https://unpkg.com/mocha/mocha.js"></script>
<script>
mocha.setup('bdd');
</script>
<script>
afterEach(function () {
var isFailed = this.currentTest.state == 'failed';
var isManual = this.currentTest.parent.title === 'Manual';
Konva.stages.forEach(function (stage) {
clearTimeout(stage.dblTimeout);
});
if (!isFailed && !isManual) {
Konva.stages.forEach(function (stage) {
stage.destroy();
});
if (Konva.DD._dragElements.size) {
throw 'Why drag elements are not cleaned?';
}
}
});
</script>
<script>
// CORE
import './unit/Animation-test.ts';
import './unit/Canvas-test.ts';
import './unit/Container-test.ts';
import './unit/Context-test.ts';
import './unit/DragAndDrop-test.ts';
import './unit/Global-test.ts';
import './unit/Group-test.ts';
import './unit/Layer-test.ts';
import './unit/Util-test.ts';
import './unit/Stage-test.ts';
import './unit/Shape-test.ts';
import './unit/Node-test.ts';
import './unit/Node-cache-test.ts';
// SHAPES
import './unit/Rect-test.ts';
import './unit/Circle-test.ts';
import './unit/Image-test.ts';
import './unit/Line-test.ts';
import './unit/Text-test.ts';
import './unit/Blob-test.ts';
import './unit/Ellipse-test.ts';
import './unit/Polygon-test.ts';
import './unit/Spline-test.ts';
import './unit/Sprite-test.ts';
import './unit/Wedge-test.ts';
import './unit/Arc-test.ts';
import './unit/Ring-test.ts';
import './unit/Label-test.ts';
import './unit/Star-test.ts';
import './unit/RegularPolygon-test.ts';
import './unit/Path-test.ts';
import './unit/TextPath-test.ts';
import './unit/Arrow-test.ts';
import './unit/Transformer-test.ts';
// events
import './unit/DragAndDropEvents-test.ts';
import './unit/MouseEvents-test.ts';
import './unit/TouchEvents-test.ts';
import './unit/PointerEvents-test.ts';
</script>
<script>
mocha.run();
</script>
<div id="konva-container"></div>
<img
src="url:./assets/lion.png"
alt="test image"
id="lion.png"
style="display: none"
/>
<img
src="url:./assets/darth-vader.jpg"
alt="test image"
id="darth-vader.jpg"
style="display: none"
/>
<img
src="url:./assets/scorpion-sprite.png"
alt="test image"
id="scorpion-sprite.png"
style="display: none"
/>
</body>
</html>