mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-27 03:55:20 +03:00
Delete typescript test
We'll soon no longer have a great way to test this in the repository, but the support has effectively never regressed so far. Let's rely on user-facing bug reports for now and otherwise we can add this back in later if necessary.
This commit is contained in:
parent
2ee4ab362d
commit
1dd8bc078e
@ -5,4 +5,3 @@ extern crate wasm_bindgen_test_project_builder as project_builder;
|
||||
use project_builder::project;
|
||||
|
||||
mod comments;
|
||||
mod typescript;
|
||||
|
@ -1,79 +0,0 @@
|
||||
use super::project;
|
||||
|
||||
#[test]
|
||||
fn works() {
|
||||
project()
|
||||
.webpack(true)
|
||||
.file(
|
||||
"src/lib.rs",
|
||||
r#"
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
extern crate wasm_bindgen;
|
||||
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn foo() {}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn bar(a: &str, b: u32) -> String {
|
||||
format!("{} {}", a, b)
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn thunk(a: &JsValue) {
|
||||
drop(a);
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub struct A {
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
impl A {
|
||||
#[wasm_bindgen(constructor)]
|
||||
pub fn new() -> A {
|
||||
A {}
|
||||
}
|
||||
|
||||
pub fn new2() -> A {
|
||||
A {}
|
||||
}
|
||||
|
||||
pub fn foo(&self) {}
|
||||
|
||||
pub fn bar(&self, _a: u32) {}
|
||||
|
||||
pub fn baz(&self, _d: &A) {}
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"test.ts",
|
||||
r#"
|
||||
import * as assert from 'assert';
|
||||
import { foo, bar, A, thunk } from './out';
|
||||
import { memory } from './out_bg';
|
||||
|
||||
export function test() {
|
||||
foo();
|
||||
assert.strictEqual(bar('a', 3), 'a 3');
|
||||
|
||||
const x = new A();
|
||||
x.foo();
|
||||
x.free();
|
||||
|
||||
const y = A.new2();
|
||||
y.foo();
|
||||
y.bar(2);
|
||||
y.baz(y);
|
||||
y.free();
|
||||
|
||||
thunk(memory);
|
||||
};
|
||||
"#,
|
||||
)
|
||||
.test();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user