mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-26 11:11:34 +00:00
Add button element tests for web-sys. (#577)
This commit is contained in:
committed by
Alex Crichton
parent
fa4b636c25
commit
2a721737ab
33
crates/web-sys/tests/all/head_element.rs
Normal file
33
crates/web-sys/tests/all/head_element.rs
Normal file
@ -0,0 +1,33 @@
|
||||
use super::websys_project;
|
||||
|
||||
#[test]
|
||||
fn head_element() {
|
||||
websys_project()
|
||||
.file(
|
||||
"src/lib.rs",
|
||||
r#"
|
||||
#![feature(use_extern_macros, wasm_custom_section)]
|
||||
extern crate wasm_bindgen;
|
||||
use wasm_bindgen::prelude::*;
|
||||
extern crate web_sys;
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn test_head_element(_element: &web_sys::HtmlHeadElement) {
|
||||
assert!(true, "Head doesn't have an interface");
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"test.js",
|
||||
r#"
|
||||
import * as assert from "assert";
|
||||
import * as wasm from "./out";
|
||||
|
||||
export function test() {
|
||||
let head = document.createElement("head");
|
||||
wasm.test_head_element(head);
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.test();
|
||||
}
|
Reference in New Issue
Block a user