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

fix: rework JS tests + fix timers impl #40

Merged
merged 4 commits into from
Feb 13, 2023
Merged

fix: rework JS tests + fix timers impl #40

merged 4 commits into from
Feb 13, 2023

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Feb 13, 2023

Refactor Runtime Web API tests - move all test code into external JavaScript files and rework the test runner to simply execute those files. This is the first step on a longer journey - I'd like to add more structure to these test files at some point in the future, e.g. using Deno.test or something similar.

After this change, the setTimeout test started to fail - the callback was never invoked!

As part of the change, I am also fixing that bug.

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@bajtos bajtos changed the title Rework JS tests + fix timers impl fix: rework JS tests + fix timers impl Feb 13, 2023
);

js_tests!(globals_tests);
js_tests!(timers_tests);
Copy link
Member Author

Choose a reason for hiding this comment

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

Hard-coding the list of test files in the Rust source allows the VS Code extension to understand that each JS file is a standalone integration test. As a result, we get "Run Test" and "Debug" actions rendered in the IDE.

Screenshot 2023-02-13 at 12 59 32

@bajtos bajtos merged commit ad6e14e into main Feb 13, 2023
@bajtos bajtos deleted the test-fix-timers branch February 13, 2023 12:15
Copy link
Member

@juliangruber juliangruber left a comment

Choose a reason for hiding this comment

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

nice work!

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.

2 participants