mirror of
https://github.com/visgl/luma.gl.git
synced 2026-02-01 14:33:49 +00:00
35 lines
887 B
JavaScript
35 lines
887 B
JavaScript
import test from 'tape-catch';
|
|
import {createGLContext} from '../../headless';
|
|
import {VertexArrayObject} from '../../dist/webgl';
|
|
|
|
|
|
const fixture = {
|
|
gl: createGLContext()
|
|
};
|
|
|
|
test('WebGL#VertexArrayObject construct/delete', t => {
|
|
const {gl} = fixture;
|
|
|
|
if (!VertexArrayObject.isSupported(gl)) {
|
|
t.comment('- VertexArrayObject not supported, skipping tests');
|
|
t.end();
|
|
return;
|
|
}
|
|
|
|
t.throws(
|
|
() => new VertexArrayObject(),
|
|
/.*WebGLRenderingContext.*/,
|
|
'VertexArrayObject throws on missing gl context');
|
|
|
|
const vao = new VertexArrayObject(gl);
|
|
t.ok(vao instanceof VertexArrayObject, 'VertexArrayObject construction successful');
|
|
|
|
vao.delete();
|
|
t.ok(vao instanceof VertexArrayObject, 'VertexArrayObject delete successful');
|
|
|
|
vao.delete();
|
|
t.ok(vao instanceof VertexArrayObject, 'VertexArrayObject repeated delete successful');
|
|
|
|
t.end();
|
|
});
|