You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
async error inside before won't cause test error #52399
Right, there is an asynchronous action and you don't wait for it to finish (and fail) so the test passes, I'm not sure how that's unexpected behavior?
Is the ask for better debugging? (e.g. log the error) or actually fail a test? The issue with the latter is the te test could have already completed by the time some unawaited async action failed in a hook. This is not specific to hooks (it's a property of js).
I think it would be reasonable to have the same "Warning: Test generated asynchronous activity after the test ended." warning we have for testts.
Right, there is an asynchronous action and you don't wait for it to finish (and fail) so the test passes, I'm not sure how that's unexpected behavior?
Not I don't want to use await, actually there're many process.nextTick logic inside nodejs source code, and test runner won't throw correct error to the user
Activity
[-]error inside before won't cause test error[/-][+]async error inside before won't cause test error[/+]himself65 commentedon Apr 7, 2024
benjamingr commentedon Apr 7, 2024
Right, there is an asynchronous action and you don't wait for it to finish (and fail) so the test passes, I'm not sure how that's unexpected behavior?
Is the ask for better debugging? (e.g. log the error) or actually fail a test? The issue with the latter is the te test could have already completed by the time some unawaited async action failed in a hook. This is not specific to hooks (it's a property of js).
I think it would be reasonable to have the same "Warning: Test generated asynchronous activity after the test ended." warning we have for testts.
himself65 commentedon Apr 7, 2024
Not I don't want to use await, actually there're many
process.nextTicklogic inside nodejs source code, and test runner won't throw correct error to the userbenjamingr commentedon Apr 7, 2024
@himself65 it arguably does, the whole execution can finish before the error is thrown in the async case, though a warning seems approprite
himself65 commentedon Apr 7, 2024
I fell like this more like a bug, error is actually be caught but never show it to user
himself65 commentedon Apr 7, 2024
OK, i'm opening PR now
test_runner: better error handing for test hook
test_runner: better error handing for test hook
test_runner: better error handing for test hook
test_runner: better error handing for test hook