//! Test suite for the Web and headless browsers.
#![cfg(target_arch = "wasm32")]
extern crate wasm_bindgen_test;
use wasm_bindgen_test::*;
wasm_bindgen_test_configure!(run_in_browser);
#[wasm_bindgen_test]
fn basic_merge() {
// arrange
let array: js_sys::Array = js_sys::Array::new();
let file1 = wasm_bindgen::JsValue::from_str(
"
file1 tracks
1
2152.8
",
);
let file2 = wasm_bindgen::JsValue::from_str(
"
file2 tracks
1
2556.8
",
);
array.push(&file1);
array.push(&file2);
let exp = wasm_bindgen::JsValue::from_str(
"
merged
file1 tracks
1
2152.8
file2 tracks
1
2556.8
",
);
// act
let obs = gpx_web_utils::merge(array);
// assert
assert_eq!(obs, exp);
}
// TODO: https://github.com/rustwasm/wasm-bindgen/issues/2286
// #[wasm_bindgen_test]
// #[should_panic]
// fn invalid_inputs() {
// let array: js_sys::Array = js_sys::Array::new_with_length(10);
// let obs = gpx_web_utils::merge(array);
// }