@osobh/reactar
Version:
AR Library for React Native and Expo
24 lines (20 loc) • 479 B
JavaScript
// __mocks__/expo-gl.js
const React = require('react');
const GLView = jest.fn(({ onContextCreate, ...props }) => {
const gl = {
canvas: {},
drawingBufferWidth: 100,
drawingBufferHeight: 100,
endFrameEXP: jest.fn(),
createContextAsync: jest.fn(),
destroyContextAsync: jest.fn(),
takeSnapshotAsync: jest.fn()
};
if (onContextCreate) {
onContextCreate(gl);
}
return React.createElement('div', props);
});
module.exports = {
GLView
};