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 different jest environments #116

Merged
merged 4 commits into from
May 14, 2020

Conversation

mmarkelov
Copy link
Member

@mmarkelov mmarkelov commented Apr 29, 2020

Some thoughts on #115
After it we can use it with custom testEnvironment:

const PlaywrightEnvironment = require('jest-playwright-preset/lib/PlaywrightEnvironment').getPlaywrightEnv('jsdom')

module.exports = PlaywrightEnvironment

Yeah! That's not perfect. I just thinking about using lerna for next releases, cause I suppose we'll need also rewrite jest-dev-server #104

@github-actions
Copy link

Pull Request Test Coverage Report for Build 91500839

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 94.03%

Totals Coverage Status
Change from base Build 87103375: 0.0%
Covered Lines: 75
Relevant Lines: 76

💛 - Coveralls

@mmarkelov mmarkelov marked this pull request as ready for review May 13, 2020 09:57
@mmarkelov mmarkelov requested a review from mxschmitt May 13, 2020 09:57
@mmarkelov
Copy link
Member Author

I just made some rewriting here. And I wanna make jest-playwright-jsdom env to support browser as separate package, like jest-environment-jsdom and jest-environment-node

if (page) {
page.removeListener('pageerror', handleError)
}
if (context) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe we can simplify the whole function in something like that. Its enough to only call browser.close().

const wait = []
if (browser) {
wait.push(browser.close())
}
if (!jestConfig.watch && !jestConfig.watchAll && teardownServer) {
wait.push(teardownServer())
}
await Promise.all(...wait)

Copy link
Collaborator

@mxschmitt mxschmitt left a comment

Choose a reason for hiding this comment

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

big diff, but seems ok if most of it is just indention changes.

@mmarkelov
Copy link
Member Author

big diff, but seems ok if most of it is just indention changes.

It's only separating types from constants =)

@mmarkelov mmarkelov merged commit d41ca51 into master May 14, 2020
@mmarkelov mmarkelov deleted the Support-different-jest-environments branch May 14, 2020 08:26
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