Skip to content

Commit

Permalink
Reduce test output length
Browse files Browse the repository at this point in the history
  • Loading branch information
bokub committed Mar 31, 2018
1 parent 3626bf9 commit 3e13c0f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,25 @@ for (const effect of effects) {
});

test.cb(`animations are starting automatically (${effect})`, t => {
const an = a[effect]('Lorem ipsum\ndolor sit amet', effect === 'neon' ? 100 : 10);
const an = a[effect]('Lorem ipsum\ndolor sit amet');
const interval = setInterval(() => {
if (an.f > 2) {
clearInterval(interval);
t.pass();
t.end(); // Exit the test right when there is a result
}
}, 10);
setTimeout(() => {
t.true(an.f > 1);
t.true(an.f > 2);
t.end();
}, 20);
}, 1500);
});

test.cb(`console.log stops the animation (${effect})`, t => {
const an = a[effect]('Lorem ipsum\ndolor sit amet');
setTimeout(() => {
t.is(an.stopped, false);
console.log('Test log');
console.log('This log should stop the animation');
t.is(an.stopped, true);
t.end();
}, 20);
Expand Down

0 comments on commit 3e13c0f

Please sign in to comment.