blob2d
Version:
Typed Modular 2D Game Engine for Web
50 lines (46 loc) • 1.08 kB
text/typescript
import {
linear,
easeInQuad,
easeOutQuad,
easeInOutQuad,
easeInCubic,
easeOutCubic,
easeInOutCubic,
easeInQuart,
easeOutQuart,
easeInOutQuart,
easeInQuint,
easeOutQuint,
easeInOutQuint,
easeInElastic,
easeOutElastic,
easeInOutElastic,
} from './easing';
describe.each([
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
])('%p', (fn, a, b, c) => {
it(`returns ${a} for value 0`, () => {
expect(fn(0)).toBe(a);
});
it(`returns ${b} for value 0.5`, () => {
expect(fn(0.5)).toBe(b);
});
it(`returns ${c} for value 1`, () => {
expect(fn(1)).toBe(c);
});
});