chore: 添加第三方依赖库
This commit is contained in:
23
thirdparty/rapier.js/rapier-compat/tests/World2d.test.ts
vendored
Normal file
23
thirdparty/rapier.js/rapier-compat/tests/World2d.test.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import {init, Vector2, World} from "../builds/2d-deterministic/pkg";
|
||||
|
||||
describe("2d/World", () => {
|
||||
let world: World;
|
||||
|
||||
beforeAll(init);
|
||||
|
||||
afterAll(async () => {
|
||||
await Promise.resolve();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
world = new World(new Vector2(0, 9.8));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
world.free();
|
||||
});
|
||||
|
||||
test("constructor", () => {
|
||||
expect(world.colliders.len()).toBe(0);
|
||||
});
|
||||
});
|
||||
23
thirdparty/rapier.js/rapier-compat/tests/World3d.test.ts
vendored
Normal file
23
thirdparty/rapier.js/rapier-compat/tests/World3d.test.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import {init, Vector3, World} from "../builds/3d-deterministic/pkg";
|
||||
|
||||
describe("3d/World", () => {
|
||||
let world: World;
|
||||
|
||||
beforeAll(init);
|
||||
|
||||
afterAll(async () => {
|
||||
await Promise.resolve();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
world = new World(new Vector3(0, 9.8, 0));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
world.free();
|
||||
});
|
||||
|
||||
test("constructor", () => {
|
||||
expect(world.colliders.len()).toBe(0);
|
||||
});
|
||||
});
|
||||
15
thirdparty/rapier.js/rapier-compat/tests/math2d.test.ts
vendored
Normal file
15
thirdparty/rapier.js/rapier-compat/tests/math2d.test.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import {Vector2, VectorOps} from "../builds/2d-deterministic/pkg";
|
||||
|
||||
describe("2d/math", () => {
|
||||
test("Vector2", () => {
|
||||
const v = new Vector2(0, 1);
|
||||
expect(v.x).toBe(0);
|
||||
expect(v.y).toBe(1);
|
||||
});
|
||||
|
||||
test("VectorOps", () => {
|
||||
const v = VectorOps.new(0, 1);
|
||||
expect(v.x).toBe(0);
|
||||
expect(v.y).toBe(1);
|
||||
});
|
||||
});
|
||||
17
thirdparty/rapier.js/rapier-compat/tests/math3d.test.ts
vendored
Normal file
17
thirdparty/rapier.js/rapier-compat/tests/math3d.test.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import {Vector3, VectorOps} from "../builds/3d-deterministic/pkg";
|
||||
|
||||
describe("3d/math", () => {
|
||||
test("Vector3", () => {
|
||||
const v = new Vector3(0, 1, 2);
|
||||
expect(v.x).toBe(0);
|
||||
expect(v.y).toBe(1);
|
||||
expect(v.z).toBe(2);
|
||||
});
|
||||
|
||||
test("VectorOps", () => {
|
||||
const v = VectorOps.new(0, 1, 2);
|
||||
expect(v.x).toBe(0);
|
||||
expect(v.y).toBe(1);
|
||||
expect(v.z).toBe(2);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user