Files
hyperframes/packages/core/src/runtime/init.authoredOrder.test.ts
T
Miguel Ángel 75fe18c621 fix(core): a set written before its tween no longer erases the tween's end (#7397)
* 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
2026-11-08 06:03:31 +00:00

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);
});