membrane icon indicating copy to clipboard operation
membrane copied to clipboard

Improve testing support for `membrane.webgl` backend.

Open phronmophobic opened this issue 2 years ago • 2 comments

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 avatar Aug 12 '22 17:08 phronmophobic

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 avatar Aug 12 '22 17:08 phronmophobic

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

phronmophobic avatar Oct 06 '23 18:10 phronmophobic