mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-05-18 01:11:10 -04:00
Build a mock Timer class and add tests for it
This commit is contained in:
parent
d1d5b80d55
commit
7f80fe17b3
4 changed files with 189 additions and 1 deletions
test/unit
|
@ -32,7 +32,7 @@ test('start / timeElapsed', t => {
|
|||
timer.start();
|
||||
|
||||
// Wait and measure timer
|
||||
setTimeout(() => {
|
||||
timer.setTimeout(() => {
|
||||
const timeElapsed = timer.timeElapsed();
|
||||
t.ok(timeElapsed >= 0);
|
||||
t.ok(timeElapsed >= (delay - threshold) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue