Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting wasm-bindgen-test? #120

Open
anp opened this issue May 3, 2020 · 1 comment
Open

Supporting wasm-bindgen-test? #120

anp opened this issue May 3, 2020 · 1 comment

Comments

@anp
Copy link

anp commented May 3, 2020

AFAICT the main obstacles to supporting code running in a wasm-bindgen-test context relate to loading information about the project workspace and the snapshot files themselves. Anything else?

The main approaches to loading that data that come to mind for me right now:

  1. have a version of the macros which (somehow?) make use of include_str! -- this would be more tedious to set up but understandable given environment constraints
  2. some way of cooperating with wasm-bindgen-cli to load the files from the parent filesystem
  3. ???

I'm curious if it's something the authors have thought about, and if so what other directions seem promising.

@mitsuhiko
Copy link
Owner

I haven't investigate this at all yet. insta really could benefit from a few utilities provided by either rusttest or the language itself so I wouldn't be surprised we run into more of those. For instance another thing is that we're using the thread name to find the test name which is known to be an issue (rust-lang/rust#70492). Likewise we don't have a reliable way to get the cargo workspace root (rust-lang/cargo#3946).

Both of those things are likely what you will encounter in a more painful form in your wasm environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants