@osobh/reactar
Version:
AR Library for React Native and Expo
47 lines (40 loc) • 1.14 kB
JavaScript
// __mocks__/ammo.js
const AmmoMock = {
btVector3: jest.fn().mockImplementation(() => ({
setX: jest.fn(),
setY: jest.fn(),
setZ: jest.fn(),
x: jest.fn(),
y: jest.fn(),
z: jest.fn()
})),
btTransform: jest.fn().mockImplementation(() => ({
setOrigin: jest.fn(),
setRotation: jest.fn(),
getOrigin: jest.fn(),
getRotation: jest.fn()
})),
btDefaultMotionState: jest.fn().mockImplementation(() => ({
getWorldTransform: jest.fn(),
setWorldTransform: jest.fn()
})),
btRigidBody: jest.fn().mockImplementation(() => ({
setMass: jest.fn(),
setFriction: jest.fn(),
setRestitution: jest.fn(),
applyCentralForce: jest.fn(),
getMotionState: jest.fn(),
setMotionState: jest.fn()
})),
btDiscreteDynamicsWorld: jest.fn().mockImplementation(() => ({
addRigidBody: jest.fn(),
removeRigidBody: jest.fn(),
stepSimulation: jest.fn(),
setGravity: jest.fn()
})),
btDefaultCollisionConfiguration: jest.fn(),
btCollisionDispatcher: jest.fn(),
btDbvtBroadphase: jest.fn(),
btSequentialImpulseConstraintSolver: jest.fn()
};
module.exports = AmmoMock;