Allow overriding headless test URL (#3861)

This commit is contained in:
Lynn
2024-03-02 08:58:19 +01:00
committed by GitHub
parent 002307746e
commit 0095fa73c9
2 changed files with 5 additions and 1 deletions

View File

@@ -17,6 +17,9 @@
* Add support for `Option<*const T>`, `Option<*mut T>` and `NonNull<T>`.
[#3852](https://github.com/rustwasm/wasm-bindgen/pull/3852)
* Allow overriding the URL used for headless tests by setting `WASM_BINDGEN_TEST_ADDRESS`.
[#3861](https://github.com/rustwasm/wasm-bindgen/pull/3861)
### Changed
* Allow using `'static` lifetimes in functions marked with `#[wasm_bindgen]`. This does not allow references where they were not allowed before!

View File

@@ -121,7 +121,8 @@ pub fn run(server: &SocketAddr, shell: &Shell, timeout: u64) -> Result<(), Error
// Visit our local server to open up the page that runs tests, and then get
// some handles to objects on the page which we'll be scraping output from.
let url = format!("http://{}", server);
let url =
std::env::var("WASM_BINDGEN_TEST_ADDRESS").unwrap_or_else(|_| format!("http://{}", server));
shell.status(&format!("Visiting {}...", url));
client.goto(&id, &url)?;
shell.status("Loading page elements...");