@web-dom/west

0.0.0 • Public • Published

West

My super simple tester for web assembly. It iterates through every exported function that starts with "test" and calls the function.

  • if it's a 0, it assumes the test passes
  • if it's non-zero, it assumes the test failed and the value represents the start of a C-string saying what went wrong
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
  </head>
  <body></body>
  <script src="west.js"></script>
  <script>
    west("test.wasm");
  </script>
</html>

See a demo here

What if I have other imports

Other imports can be mocked out to do whatever you like with an additional argument:

west("test.wasm",{
  my_imported_function(){
    //do nothing during tests
  });

Readme

Keywords

Package Sidebar

Install

npm i @web-dom/west

Weekly Downloads

1

Version

0.0.0

License

MIT

Unpacked Size

2.53 kB

Total Files

3

Last publish

Collaborators

  • richardanaya