konva/test/runner.js

42 lines
936 B
JavaScript
Raw Normal View History

mocha.ui('tdd');
var assert = chai.assert,
kineticContainer = document.getElementById('kinetic-container');
Kinetic.enableTrace = true;
2013-09-09 12:36:54 +08:00
function addStage() {
var container = document.createElement('div'),
stage = new Kinetic.Stage({
container: container,
width: 578,
height: 200
});
kineticContainer.appendChild(container);
return stage;
}
2013-09-09 12:36:54 +08:00
function addContainer() {
var container = document.createElement('div');
kineticContainer.appendChild(container);
return container;
}
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);
});