membrane
membrane copied to clipboard
Improve testing support for `membrane.webgl` backend.
Loading the membrane.webgl
namespace will throw an exception if some of the browser APIs are missing. This makes it annoying for writing/running tests outside of the browser environment.
Also, on principle, it probably shouldn't throw an exception when loading the namespace regardless of whether the broswer APIs are available.
Some ideas for suggestions for fixes/improvements:
- Write all the
membrane.webgl
code against a protocol so that it can be mocked/substituted - use delays for any top level definitions
Some specific problem expressions:
- membrane.audio also has this problem
- https://github.com/phronmophobic/membrane/blob/7e82b68f7a5b70a5d1c5f7e3db8f91c0230069ad/src/membrane/webgl.cljs#L579C38-L579C38
- https://github.com/phronmophobic/membrane/blob/7e82b68f7a5b70a5d1c5f7e3db8f91c0230069ad/src/membrane/webgl.cljs#L165