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

Tests for type embeds #71

Merged
merged 7 commits into from
Mar 15, 2021
Merged

Tests for type embeds #71

merged 7 commits into from
Mar 15, 2021

Conversation

surma
Copy link
Collaborator

@surma surma commented Mar 14, 2021

So, yes, another PR. @torch2424 I hope you don’t feel like this is becoming a hostile takeover or anything. The reason for a 2nd PR is actually exactly the opposite — I wanna make sure you still feel like this is your code base. I just wanna help out a bit. The PR goes into my other PR #70, to keep things a little easier to digest. I also don’t want to continue working on #70 until I have tests to make sure I am not just scewing everything up (as writing the tests has already uncovered some bugs 🙈 )


What’s in here?

The goal of this PR is to refactor test infrastructure so that it’s easier to add tests and to have the same tests be run in the browser and in Node. This will become increasingly important with more diverging Wasm engine feature support. Specifically:

  • Replaced Mocha CLI invocation with a custom script that runs the tests in both Node and in Chrome via puppeteer.
  • Each test suite has it’s own subfolder with its own asc.ts that gets compiled just in time before the tests are run. (In the future we can expose hooks here to adjust the flags for the ASC compiler for experimental features etc).
  • Update Mocha to latest version

@torch2424 Are you comfortable with this and merging it into my other branch?

Copy link
Owner

@torch2424 torch2424 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yoooo! Yeah no worries, this is all rad!

Super happy to have tests run in both node and chrome, that makes sense to me, and looks really good!

Approving this. But, just to confirm, we'd be running more tests than just ArrayBufferViews? 😄

@@ -30,8 +30,8 @@ async function compileStreaming(source) {
if (WebAssembly.compileStreaming) {
return WebAssembly.compileStreaming(source);
}
source = await Promise.resolve(souce);
if (source instanceof Response) {
source = await Promise.resolve(source);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, didn't know I had a type here 😂

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was my typo, not yours 😅

@surma
Copy link
Collaborator Author

surma commented Mar 15, 2021

Approving this. But, just to confirm, we'd be running more tests than just ArrayBufferViews? 😄

Cheers mate! Yeah, already wrote a bunch more tests. Definitely looking to fill it up more

@surma surma merged commit 7f0b5a4 into type-embed Mar 15, 2021
@surma surma deleted the type-embed-tests branch March 15, 2021 20:07
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

Successfully merging this pull request may close these issues.

None yet

2 participants