mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 20:41:24 +00:00
Migrate webidl
tests to wasm_bindgen_test
(#590)
This commit moves the `webidl/tests` folder to a new `crates/webidl-tests` crate (to have a test-only build script) and ports them to the `#[wasm_bindgen_test]` attribute, which should hopefully make testing much speedier for execution!
This commit is contained in:
21
crates/webidl-tests/enums.js
Normal file
21
crates/webidl-tests/enums.js
Normal file
@ -0,0 +1,21 @@
|
||||
global.Shape = class Shape {
|
||||
constructor(kind) {
|
||||
this.kind = kind;
|
||||
}
|
||||
|
||||
static triangle() {
|
||||
return new Shape('triangle');
|
||||
}
|
||||
|
||||
isSquare() {
|
||||
return this.kind === 'square';
|
||||
}
|
||||
|
||||
isCircle() {
|
||||
return this.kind === 'circle';
|
||||
}
|
||||
|
||||
getShape() {
|
||||
return this.kind;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user