mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-05-16 16:30:43 -04:00
Use ES6 linting rules in the project root
Update all tests for `no-var` and `prefer-arrow-callback` (using `--fix`)
This commit is contained in:
parent
5f59d1e7e5
commit
bafdf8d9f2
36 changed files with 666 additions and 666 deletions
test/unit
|
@ -1,8 +1,8 @@
|
|||
var test = require('tap').test;
|
||||
var Timer = require('../../src/util/timer');
|
||||
const test = require('tap').test;
|
||||
const Timer = require('../../src/util/timer');
|
||||
|
||||
test('spec', function (t) {
|
||||
var timer = new Timer();
|
||||
test('spec', t => {
|
||||
const timer = new Timer();
|
||||
|
||||
t.type(Timer, 'function');
|
||||
t.type(timer, 'object');
|
||||
|
@ -15,25 +15,25 @@ test('spec', function (t) {
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('time', function (t) {
|
||||
var timer = new Timer();
|
||||
var time = timer.time();
|
||||
test('time', t => {
|
||||
const timer = new Timer();
|
||||
const time = timer.time();
|
||||
|
||||
t.ok(Date.now() >= time);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('start / timeElapsed', function (t) {
|
||||
var timer = new Timer();
|
||||
var delay = 100;
|
||||
var threshold = 1000 / 60; // 60 hz
|
||||
test('start / timeElapsed', t => {
|
||||
const timer = new Timer();
|
||||
const delay = 100;
|
||||
const threshold = 1000 / 60; // 60 hz
|
||||
|
||||
// Start timer
|
||||
timer.start();
|
||||
|
||||
// Wait and measure timer
|
||||
setTimeout(function () {
|
||||
var timeElapsed = timer.timeElapsed();
|
||||
setTimeout(() => {
|
||||
const timeElapsed = timer.timeElapsed();
|
||||
t.ok(timeElapsed >= 0);
|
||||
t.ok(timeElapsed >= (delay - threshold) &&
|
||||
timeElapsed <= (delay + threshold));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue