File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ extern crate wasm_bindgen_test_project_builder as project_builder;
2
2
use project_builder:: project;
3
3
4
4
mod event;
5
+ mod response;
Original file line number Diff line number Diff line change
1
+ use super :: project;
2
+
3
+ #[ test]
4
+ fn response ( ) {
5
+ project ( )
6
+ . add_local_dependency ( "web-sys" , env ! ( "CARGO_MANIFEST_DIR" ) )
7
+ . headless ( true )
8
+ . file (
9
+ "src/lib.rs" ,
10
+ r#"
11
+ #![feature(proc_macro, wasm_custom_section)]
12
+ extern crate wasm_bindgen;
13
+ use wasm_bindgen::prelude::*;
14
+ extern crate web_sys;
15
+
16
+ #[wasm_bindgen]
17
+ pub fn test_response(response: &web_sys::Response) {
18
+ assert!(!response.ok());
19
+ assert!(!response.redirected());
20
+ assert_eq!(response.status(), 501);
21
+ }
22
+ "# ,
23
+ )
24
+ . file (
25
+ "test.js" ,
26
+ r#"
27
+ import * as assert from "assert";
28
+ import * as wasm from "./out";
29
+
30
+ export function test() {
31
+ let response = new Response(null, {status: 501});
32
+ wasm.test_response(response);
33
+ }
34
+ "# ,
35
+ )
36
+ . test ( ) ;
37
+ }
File renamed without changes.
You can’t perform that action at this time.
0 commit comments