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::HtmlHtmlElement;
#[wasm_bindgen(module = "./tests/wasm/element.js")]
extern {
#[wasm_bindgen(js_name = new_html)]
fn make_html() -> HtmlHtmlElement;
}
#[wasm_bindgen_test]
fn test_html_html_element() {
let element = make_html();
assert_eq!(element.version(), "", "Shouldn't have a version");
element.set_version("4");
assert_eq!(element.version(), "4", "Should have a version");
}