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

Support return array #22

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

tunnckoCore
Copy link

resolves #20 and #21

Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
@tunnckoCore
Copy link
Author

tunnckoCore commented Oct 2, 2019

Someone on that? @SimenB?

Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
@KaiSpencer
Copy link

Any chance getting this merged. Got a fork with these changes only would be good if they were in the repo.

if (Array.isArray(testResult)) {
testResult.forEach(result =>
result.numFailingTests > 0
? onFailure(test, new Error(result.errorMessage))
Copy link
Member

Choose a reason for hiding this comment

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

is this correct? I thought onResult was called with all test results regardless of whether the result is a failure or not, and onFailure was called if the test framework errored out. That might be wrong though, I haven't looked into the source code of this module for some time 😅

Could you show an example of how this is used in a runner and how it looks when used in Jest?

Copy link

Choose a reason for hiding this comment

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

You are correct, onFailure is when the framework errors out. It is passed a SerializableError

I am working on this jest-python. It would be good to see if it was at all possible to simplify its implementation with this library.

.then(testResult => {
if (Array.isArray(testResult)) {
testResult.forEach(result =>
result.numFailingTests > 0
Copy link
Member

Choose a reason for hiding this comment

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

Can you do an if rather than the ternary?

Copy link
Author

Choose a reason for hiding this comment

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

ok, soon maybe cuz I'm not active in the past year.

@SimenB
Copy link
Member

SimenB commented Sep 14, 2022

@tunnckoCore ping 🙂

@tunnckoCore
Copy link
Author

Uh yea, hey there, long time... I can't get on that soon. Not that active.

I published a fork on my @tunnckocore scope back then, and runners that I needed or that I created are using it. But mostly migrated out of Jest.

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.

Support returning array of TestResult
3 participants