1 use wasm_bindgen::prelude::*; 2 use wasm_bindgen_test::*; 3 use web_sys::HtmlPreElement; 4 5 #[wasm_bindgen(module = "/tests/wasm/element.js")] 6 extern "C" { new_pre() -> HtmlPreElement7 fn new_pre() -> HtmlPreElement; 8 } 9 10 #[wasm_bindgen_test] test_pre_element()11fn test_pre_element() { 12 let pre = new_pre(); 13 pre.set_width(150); 14 assert_eq!(pre.width(), 150, "Pre width should be 150."); 15 } 16