From 6fd9683da83936fb4b67dcdf948f99f461cc8da8 Mon Sep 17 00:00:00 2001 From: AZhan Date: Wed, 21 May 2025 13:36:38 +0800 Subject: [PATCH] test: add bounding box unit test (#2668) --- tests/src/math/BoundingBox.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/src/math/BoundingBox.test.ts b/tests/src/math/BoundingBox.test.ts index 7d49f2c00..71e4a8245 100644 --- a/tests/src/math/BoundingBox.test.ts +++ b/tests/src/math/BoundingBox.test.ts @@ -251,4 +251,11 @@ describe("BoundingBox test", () => { expect(Vector3.equals(a.min, out.min)).eq(true); expect(Vector3.equals(a.max, out.max)).eq(true); }); + + it("toJSON", () => { + const min = new Vector3(1, 2, 3); + const max = new Vector3(4, 5, 6); + const boundingBox = new BoundingBox(min, max); + expect(boundingBox.toJSON()).to.deep.eq({ min: { x: 1, y: 2, z: 3 }, max: { x: 4, y: 5, z: 6 } }); + }); });