File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1+ // the message is inconsistency between some nodejs versions
2+ const UNKNOWN_FUNCTION_TABLE = / i n v a l i d i n d e x i n t o f u n c t i o n t a b l e | i n v a l i d f u n c t i o n / ;
3+
14it ( "should support tables" , function ( ) {
25 return import ( "./wasm-table.wasm" ) . then ( function ( wasm ) {
36 expect ( wasm . callByIndex ( 0 ) ) . toEqual ( 42 ) ;
47 expect ( wasm . callByIndex ( 1 ) ) . toEqual ( 13 ) ;
5- expect ( ( ) => wasm . callByIndex ( 2 ) ) . toThrow ( "invalid function" ) ;
8+ expect ( ( ) => wasm . callByIndex ( 2 ) ) . toThrow ( UNKNOWN_FUNCTION_TABLE ) ;
69 } ) ;
710} ) ;
811
@@ -23,6 +26,6 @@ it("should support imported tables", function() {
2326 return import ( "./wasm-table-imported.wasm" ) . then ( function ( wasm ) {
2427 expect ( wasm . callByIndex ( 0 ) ) . toEqual ( 42 ) ;
2528 expect ( wasm . callByIndex ( 1 ) ) . toEqual ( 13 ) ;
26- expect ( ( ) => wasm . callByIndex ( 2 ) ) . toThrow ( "invalid function" ) ;
29+ expect ( ( ) => wasm . callByIndex ( 2 ) ) . toThrow ( UNKNOWN_FUNCTION_TABLE ) ;
2730 } ) ;
2831} ) ;
You can’t perform that action at this time.
0 commit comments