mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
34 lines
795 B
JavaScript
34 lines
795 B
JavaScript
![]() |
mocha.ui('tdd');
|
||
|
var assert = chai.assert,
|
||
|
kineticContainer = document.getElementById('kinetic-container');
|
||
|
|
||
|
Kinetic.enableTrace = true;
|
||
|
|
||
|
function buildStage() {
|
||
|
var container = document.createElement('div'),
|
||
|
stage = new Kinetic.Stage({
|
||
|
container: container,
|
||
|
width: 578,
|
||
|
height: 200
|
||
|
});
|
||
|
|
||
|
kineticContainer.appendChild(container);
|
||
|
|
||
|
return stage;
|
||
|
}
|
||
|
|
||
|
function showHit(layer) {
|
||
|
var canvas = layer.hitCanvas._canvas;
|
||
|
canvas.style.position = 'relative';
|
||
|
|
||
|
kineticContainer.appendChild(canvas);
|
||
|
}
|
||
|
|
||
|
beforeEach(function(){
|
||
|
var title = document.createElement('h2'),
|
||
|
test = this.currentTest;
|
||
|
|
||
|
title.innerHTML = test.parent.title + ' - ' + test.title;
|
||
|
title.className = 'kinetic-title';
|
||
|
kineticContainer.appendChild(title);
|
||
|
});
|