[go: nahoru, domu]

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: better error handling when test modules fail to load #15421

Merged
merged 3 commits into from
Aug 30, 2023

Conversation

connorjclark
Copy link
Collaborator

Current test runner gives no information in the summary at the end if some test file fails to be imported, meaning you have to hunt a huge output of tests to find what file failed to load.

Now the test runner first tries to import each test file, and tracks which ones fail to load.

@connorjclark connorjclark requested a review from a team as a code owner August 29, 2023 16:51
@connorjclark connorjclark requested review from brendankenny and removed request for a team August 29, 2023 16:51
for (const test of tests) {
try {
mocha.files = [test];
await mocha.loadFilesAsync();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can't just await import because mocha does some non trivial logic for importing + setting up mocha globals.

@connorjclark connorjclark changed the title tests: better error handling when test modules fails to load tests: better error handling when test modules fail to load Aug 29, 2023
core/test/scripts/run-mocha-tests.js Outdated Show resolved Hide resolved
core/test/scripts/run-mocha-tests.js Outdated Show resolved Hide resolved
@connorjclark connorjclark merged commit 375c170 into main Aug 30, 2023
29 checks passed
@connorjclark connorjclark deleted the mocha-fix-import-error branch August 30, 2023 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants