test: wasm cleanup deprecated static

This commit is contained in:
Mingwei Samuel 2025-01-13 11:56:03 -08:00
parent 29a2819341
commit 9ede8f23bb
2 changed files with 4 additions and 3 deletions

View file

@ -20,6 +20,7 @@ pub fn env_var<K: AsRef<str>>(key: K) -> Result<String, std::env::VarError> {
#[wasm_bindgen]
extern "C" {
type Process;
#[wasm_bindgen(thread_local_v2)]
static process: Process;
type Env;
@ -32,7 +33,7 @@ pub fn env_var<K: AsRef<str>>(key: K) -> Result<String, std::env::VarError> {
}
process
.env()
.with(Process::env)
.get(key.as_ref())
.ok_or(std::env::VarError::NotPresent)
}

View file

@ -5,8 +5,8 @@ export RGAPI_KEY="$(cat apikey.txt)"
cd riven
# Ensure builds with tracing.
wasm-pack build -- --features nightly,tracing
# Ensure builds with tracing, metrics.
wasm-pack build -- --features nightly,tracing,metrics
# Run tests.
wasm-pack test --node -- --features nightly,deny-unknown