wasm-bindgen/.github
Liam Murphy 8d063a4908
Fix example tests (#3614)
* Fix example tests

I went to enable testing for the `synchronous-instantiation` example now
that Firefox supports module workers, but then found that the
`wasm-audio-worklet` example was failing because the test server doesn't
set the headers needed to enable `SharedArrayBuffer`.

It turns out that CI wasn't failing because it's been broken this whole
whole time: it specifies the path to the built examples as simply
`exbuild`, which doesn't work because the tests are run with their
working directory set to `crates/example-tests`, not the root of the
repo. This means that any requests that the examples try to make will
404. So this PR specifies it as an absolute path instead.

At the moment, Firefox doesn't directly indicate any kind of error when
navigation fails, which meant that the tests would just silently fail
without actually testing anything. According to the spec,
`browsingContext.navigate` is supposed to wait for the navigation to
complete, and result in an error if something goes wrong; but I think
Firefox is behind, because it seems to instead immediately return.

To work around this, I've made it so that the tests manually wait for
the `network.responseCompleted` event to check if fetching the page
suceeded, and so this shouldn't happen again.

I've left the actual fix for the `wasm-audio-worklet` example commented
out to make sure that CI actually catches the issue now; that's why this
PR is a draft.

* properly interpolate repo root

* use correct variable

It looks like `env` is specifically for variables that you set manually,
not arbitrary environment variables.

* Fix wasm_audio_worklet

* tweak doc comment
2023-09-15 12:50:01 +10:00
..
actions/setup-geckodriver Update setup-geckodriver action to use Node 16 (#3286) 2023-02-03 17:25:26 -06:00
workflows Fix example tests (#3614) 2023-09-15 12:50:01 +10:00