Skip to content

Add a test runner to two of the typescript tests to actually run them#3704

Merged
ranile merged 5 commits intowasm-bindgen:mainfrom
thomasetter:jest
Nov 30, 2023
Merged

Add a test runner to two of the typescript tests to actually run them#3704
ranile merged 5 commits intowasm-bindgen:mainfrom
thomasetter:jest

Conversation

@thomasetter
Copy link
Copy Markdown
Contributor

@thomasetter thomasetter commented Nov 13, 2023

This adds Jest as the test runner framework.
I have chosen this framework because it was the framework I managed to get running and because it seems reasonably popular:
https://2022.stateofjs.com/en-US/libraries/testing/

This uncovers that some of the tests are unrealistic code which would crash at runtime.

Before this PR, these tests were just compiled with tsc, but never run.

This PR also adds the new test script to the crates/typescript-tests/run.sh file which makes them run in the CI.

@thomasetter
Copy link
Copy Markdown
Contributor Author

thomasetter commented Nov 13, 2023

I can fix the currently not excluded tests in follow up PRs, but wanted to get the test framework in first before I write a lot of code depending on it.

@daxpedda daxpedda added the needs review Needs a review by a maintainer. label Nov 14, 2023
Copy link
Copy Markdown
Contributor

@ranile ranile left a comment

Choose a reason for hiding this comment

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

Can you also update CI to run the tests

@thomasetter
Copy link
Copy Markdown
Contributor Author

Good point!

They are already running in the CI, as can be seen in the last few lines of Run cd crates/typescript-tests && ./run.sh in this pipeline run.

I clarified this in the PR description by mentioning the run.sh.

@thomasetter thomasetter requested a review from ranile November 30, 2023 17:14
Copy link
Copy Markdown
Contributor

@ranile ranile left a comment

Choose a reason for hiding this comment

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

Oh, sorry, I totally missed that! Thanks for the PR

@ranile ranile merged commit cfe3dc2 into wasm-bindgen:main Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Needs a review by a maintainer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants