fix(cli): exclude rendering flags from tween tail warnings (#5711)

This commit is contained in:
Rudy Mizrahi Celekli
2026-10-24 00:28:10 +00:00
committed by GitHub
parent c478110be7
commit 84e6dfd247
2 changed files with 25 additions and 0 deletions
@@ -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([]);
});
+2
View File
@@ -76,6 +76,8 @@ export function collectTweenRecords(): TweenRecord[] {
};
const NOT_PROPERTIES = new Set([
"duration",
"force3D",
"autoRound",
"delay",
"ease",
"repeat",