whs.js/test/core/Loop.js
Alexander Buzin 0cc58b3aa3 Add tests for Loop core class
Former-commit-id: 6990d8ac44322d24c0f2d48f2436a3fdb7abf9cb
2017-01-24 23:55:29 +02:00

22 lines
376 B
JavaScript

import test from 'ava';
import * as WHS from '../../build/whitestorm.js';
const app = new WHS.App();
const loop = new WHS.Loop(() => {}, false);
app.start();
test('.start()', t => {
loop.start(app);
t.true(loop.enabled);
});
test('.stop()', t => {
loop.stop(app);
t.false(loop.enabled);
});
test('.execute()', t => {
new WHS.Loop(() => t.pass()).execute();
});