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

Improve integ. with Jest in terms of logging #1351

Merged
merged 8 commits into from
May 7, 2019
Merged

Improve integ. with Jest in terms of logging #1351

merged 8 commits into from
May 7, 2019

Conversation

d4vidi
Copy link
Collaborator

@d4vidi d4vidi commented May 1, 2019


Description:

Fixes #1349.

@d4vidi d4vidi requested review from rotemmiz and noomorph May 1, 2019 14:19
@d4vidi d4vidi force-pushed the jest-boost branch 2 times, most recently from 715e130 to db66215 Compare May 1, 2019 14:25
@d4vidi d4vidi closed this May 1, 2019
@d4vidi d4vidi reopened this May 1, 2019
@noomorph
Copy link
Collaborator

noomorph commented May 1, 2019

Sure, I'll review it tomorrow

Copy link
Collaborator

@noomorph noomorph left a comment

Choose a reason for hiding this comment

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

@d4vidi, I did a quick review of the PR.
There are a few points for the dialogue and a few assignments to me, as I was the one who messed with a couple of files.
But for the most part, that's it.

detox/local-cli/init.js Outdated Show resolved Hide resolved
detox/local-cli/templates/firstTestContent.js Outdated Show resolved Hide resolved
detox/runners/jest/DetoxLifecycleAdapter.js Outdated Show resolved Hide resolved
detox/local-cli/templates/jest.js Outdated Show resolved Hide resolved
detox/local-cli/templates/jest.js Outdated Show resolved Hide resolved
docs/Guide.Jest.md Outdated Show resolved Hide resolved
docs/Guide.Jest.md Outdated Show resolved Hide resolved
docs/Guide.Migration.md Show resolved Hide resolved
examples/demo-react-native-jest/e2e/init.js Outdated Show resolved Hide resolved
examples/demo-react-native-jest/package.json Outdated Show resolved Hide resolved
@noomorph
Copy link
Collaborator

noomorph commented May 5, 2019

Good morning, @d4vidi!

I've put some more thought into what is suggested by the PR, and actually, I'm coming to a conclusion that we might want to split this PR into two.

  1. I absolutely approve the thing with Jest reporter (the one that flushes logs immediately), that is what I suggest to leave as a core of this pull request. I mentioned previously, that for the greater good we should consider suggesting that immediate flush configuration option to Jest project itself in the foreseeable future.
  2. AFAIU, the Jasmine trace reporter is not tightly related to Detox. There a few projects on the Internet (namely, Github) that contribute their reporters to Jasmine:
  • https://github.com/larrymyers/jasmine-reporters - see TerminalReporter. Has a few flaws though:
    • uses console.log instead of process.std*** (looks bad if you run inside Jest)
    • minor visual issues: mandatory "..." after test summary and no ability to flatten full name
  • https://github.com/onury/jasmine-console-reporter - has other flaws:
    • too smart - it tampers with terminal output (deletes printed lines, etc). Might conflict with Jest.
    • while it has full test title flattening, it does not seem to work right.

So I conclude two thoughts out of this:

  1. It's not that uncommon to create a separate jasmine reporter npm package. I think it's perfectly okay if we extract your trace reporter out of Detox project. In my opinion, maintaining it will be more flexible and fast and won't require releasing extra Detox versions. Detox Jest guide can encourage using it and we can add it to Jest example project.
  2. As for where to extract it, I suggest wix-incubator at this stage. However, we might try luck with contributing PR to TerminalReporter (1) as all problems listed above can be solved by adding more configuration options, IMO. There is just a risk the repo is abandoned to some extent (the last commit was 8 months ago) or that accepting PR might take too long.

So your second PR (if we split #1351) might add an opinionated recommendation to try out the new trace reporter in some of the projects, as soon as the npm package with your jasmine trace reporter is ready.

@d4vidi d4vidi force-pushed the jest-boost branch 6 times, most recently from 2e93dd3 to 399cb34 Compare May 6, 2019 10:02
@d4vidi
Copy link
Collaborator Author

d4vidi commented May 6, 2019

@noomorph with my latest commit (399cb34) re adaptive specs-reporting, I'm done with this for now. Please review.

Copy link
Collaborator

@noomorph noomorph left a comment

Choose a reason for hiding this comment

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

I won't lie — to my taste, the current implementation still seems a bit rushed and not well polished.
However, in the light of the circumstances, since we want to roll it out sooner, and as long as it is technically working in a valid way, I have no strong objections to it, there's nothing blocking now, AFAIC.

So, consider it to be approved.

@d4vidi d4vidi force-pushed the jest-boost branch 2 times, most recently from 32833e3 to 2d96ee8 Compare May 7, 2019 11:10
@d4vidi d4vidi merged commit de3d14f into master May 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2019
@d4vidi d4vidi changed the title Improve integ. with Detox in terms of logging Improve integ. with Jest in terms of logging May 22, 2019
@LeoNatan LeoNatan deleted the jest-boost branch July 22, 2019 02:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Jest's console output flow
2 participants