mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-19 11:26:02 +00:00
* fix(core): a set written before its tween no longer erases the tween's end * fix(core): shorten two comment lines to the limit * fix(core): the stamp takes any GSAP the runtime types, so the runtime typecheck passes
17 lines
740 B
TypeScript
17 lines
740 B
TypeScript
import gsap from "gsap";
|
|
import { expect, it } from "vitest";
|
|
import { installFlatGsapTransforms } from "./init";
|
|
|
|
// Its own file: the stamp patches GSAP's Timeline once for the whole process.
|
|
it("numbers the order a film writes its tweens in when GSAP loads after the runtime", () => {
|
|
installFlatGsapTransforms();
|
|
window.gsap = gsap as unknown as typeof window.gsap;
|
|
const timeline = gsap.timeline({ paused: true });
|
|
timeline.set({ a: 0 }, { a: 1 }).to({ b: 0 }, { b: 1, duration: 1 });
|
|
const [first, second] = timeline.getChildren(false, true, true) as unknown as {
|
|
_hfAuthored?: number;
|
|
}[];
|
|
expect(first?._hfAuthored).toBeDefined();
|
|
expect(second?._hfAuthored).toBeGreaterThan(first?._hfAuthored ?? Infinity);
|
|
});
|