wasm-bindgen/crates/js-sys/tests/wasm/UriError.rs

15 lines
362 B
Rust
Raw Normal View History

2018-08-10 23:37:34 +03:00
use wasm_bindgen::JsValue;
use wasm_bindgen_test::*;
use wasm_bindgen::JsCast;
use js_sys::*;
#[wasm_bindgen_test]
fn uri_error() {
let error = UriError::new("msg");
assert!(error.is_instance_of::<UriError>());
assert!(error.is_instance_of::<Error>());
let base: &Error = error.as_ref();
assert_eq!(JsValue::from(base.message()), "msg");
}