Move web-sys tests to the new test framework

Migrate most `web-sys` tests to the new `wasm_bindgen_test` framework with the
new headless browser capabilities!
This commit is contained in:
Alex Crichton
2018-07-30 08:14:50 -07:00
parent 79e281128e
commit 4282ec25bd
41 changed files with 822 additions and 1027 deletions

View File

@@ -0,0 +1,17 @@
use wasm_bindgen_test::*;
use wasm_bindgen::prelude::*;
use web_sys::HtmlDivElement;
#[wasm_bindgen(module = "./tests/wasm/element.js")]
extern {
#[wasm_bindgen(js_name = new_div)]
fn make_div() -> HtmlDivElement;
}
#[wasm_bindgen_test]
fn test_div_element() {
let element = make_div();
assert_eq!(element.align(), "", "Shouldn't have a align");
element.set_align("right");
assert_eq!(element.align(), "right", "Should have a align");
}