#![cfg(all(target_family = "wasm", feature = "persistence"))]
use cubecl_environment::persistence::{Namespace, Store, StoreOptions};
use wasm_bindgen_test::*;
wasm_bindgen_test_configure!(run_in_dedicated_worker);
#[wasm_bindgen_test]
fn a_store_before_the_open_serves_memory() {
let mut store = Store::<String, u32>::new(
StoreOptions::new().storage(Namespace::scoped("browser", "early")),
);
let description = store.to_string();
assert!(description.contains("memory ("), "{description}");
store.insert("key".to_string(), 1).unwrap();
assert_eq!(store.get(&"key".to_string()), Some(&1));
}