mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-03 20:37:30 +00:00
fix(cli): exclude rendering flags from tween tail warnings (#5711)
This commit is contained in:
@@ -117,6 +117,29 @@ describe("collectTweenRecords", () => {
|
||||
expect(findTweenTails(records)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("ignores rendering flags when finding shared tween properties", () => {
|
||||
const target = {};
|
||||
const main = fakeTimeline(0);
|
||||
fakeTween(main, target, { x: 200, duration: 1, force3D: false, autoRound: false }, 0);
|
||||
fakeTween(main, target, { opacity: 0.5, duration: 0.4, force3D: false, autoRound: false }, 0.5);
|
||||
(window as unknown as { __timelines: Record<string, unknown> }).__timelines = { main };
|
||||
|
||||
expect(collectTweenRecords().map(({ properties }) => properties)).toEqual([["x"], ["opacity"]]);
|
||||
expect(findTweenTails(collectTweenRecords())).toEqual([]);
|
||||
});
|
||||
|
||||
it("still reports a shared animated property when rendering flags are present", () => {
|
||||
const target = {};
|
||||
const main = fakeTimeline(0);
|
||||
fakeTween(main, target, { opacity: 1, duration: 1, force3D: false, autoRound: false }, 0);
|
||||
fakeTween(main, target, { opacity: 0.5, duration: 0.4, force3D: false, autoRound: false }, 0.5);
|
||||
(window as unknown as { __timelines: Record<string, unknown> }).__timelines = { main };
|
||||
|
||||
expect(findTweenTails(collectTweenRecords())).toEqual([
|
||||
expect.objectContaining({ properties: ["opacity"] }),
|
||||
]);
|
||||
});
|
||||
|
||||
it("returns nothing when no timeline is registered", () => {
|
||||
expect(collectTweenRecords()).toEqual([]);
|
||||
});
|
||||
|
||||
@@ -76,6 +76,8 @@ export function collectTweenRecords(): TweenRecord[] {
|
||||
};
|
||||
const NOT_PROPERTIES = new Set([
|
||||
"duration",
|
||||
"force3D",
|
||||
"autoRound",
|
||||
"delay",
|
||||
"ease",
|
||||
"repeat",
|
||||
|
||||
Reference in New Issue
Block a user