Improve testing support for `membrane.webgl` backend.
phronmophobic opened this issue · 2 comments
phronmophobic commented
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.
phronmophobic commented
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
phronmophobic commented
Some specific problem expressions:
- membrane.audio also has this problem
- https://github.com/phronmophobic/membrane/blob/7e82b68f7a5b70a5d1c5f7e3db8f91c0230069ad/src/membrane/webgl.cljs#L579C38-L579C38
membrane/src/membrane/webgl.cljs
Line 165 in 7e82b68