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

View file

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