Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.velocity("stop");
} catch {
// We don't care if it fails.
}
// Free all targets requested by the current test.
while (targets.length) {
try {
$qunitStage.removeChild(targets.pop());
} catch {
// We don't care if it fails.
}
}
// Ensure we have reset the test counter.
asyncTests();
// Make sure Velocity goes back to defaults.
Velocity.defaults.reset();
});
testFrame = (frameRate) => {
let counter = 0;
Velocity.defaults.fpsLimit = frameRate;
// Test if the frame rate is assigned succesfully.
assert.equal(frameRate, Velocity.defaults.fpsLimit, "Setting global fps limit to " + frameRate);
return Velocity($target, defaultProperties,
{
duration: 1000,
progress() {
counter++;
},
})
.then(() => counter);
};
testFrame = (frameRate) => {
let counter = 0;
Velocity.defaults.fpsLimit = frameRate;
// Test if the frame rate is assigned succesfully.
assert.equal(frameRate, Velocity.defaults.fpsLimit, "Setting global fps limit to " + frameRate);
return Velocity($target, defaultProperties,
{
duration: 1000,
progress() {
counter++;
},
})
.then(() => counter);
};
asyncTests(assert, 1, (done) => {
Velocity.defaults.speed = 3;
Velocity(getTarget(), defaultProperties, {
speed: 5,
begin(elements) {
assert.equal(elements.velocity.animations[0].options.speed, 5, "Speed on options overrides default.");
done();
},
});
});