Skip to content

Commit

Permalink
Minor test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma-andex committed Jan 4, 2024
1 parent 51c4e64 commit c620277
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions tests/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@ async fn fetch(url: &str) -> Result<Response, JsValue> {
opts.method("GET");
opts.mode(RequestMode::Cors);

// let url = "http://localhost:45678/tokenizer.json";

let request = Request::new_with_str_and_init(&url, &opts)?;

let window = web_sys::window().unwrap();
let resp_value = JsFuture::from(window.fetch_with_request(&request)).await?;

// `resp_value` is a `Response` object.
assert!(resp_value.is_instance_of::<Response>());
let resp: Response = resp_value.dyn_into().unwrap();

Expand All @@ -38,7 +35,6 @@ async fn fetch(url: &str) -> Result<Response, JsValue> {
async fn load_json(url: &str) -> Result<JsValue, JsValue> {
let response = fetch(url).await?;
let json = JsFuture::from(response.json()?).await?;

Ok(json)
}

Expand Down

0 comments on commit c620277

Please sign in to comment.