-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Adds native support for PnP to jest #8094
Conversation
Note that I've directly used the |
Exciting!
Yeah, that makes sense to me as a follow-up. I guess it's stable enough to not be hindered by Jest's slower release process?
Is it possible to package up a tarball for PnP? We have bunch of tests that sets up temp directories in |
From CI:
Maybe add a typings file to the project? If not, you can add a |
Another cool integration test would be that the project is usable with PnP in general, not just the resolver. I have nefarious plans to split up |
Found a way to make a test! I was worried that mixing PnP (the test env) and non-PnP (the Jest repo) wouldn't work, but PnP is smart enough to fallback to the regular Node resolution for the relevant parts of the tree when it detects this situation 🙂
I think so, yep. I haven't had to change the API in a while and I don't expect this to be very frequent. Most changes are in the PnP implementation, not its public interface.
You mean the whole Jest repo? If you're interested, we could look into making you early adopters of Yarn v2, that would be win-win! There are still probably some rough edges, but it would be instructive and I'd be happy to fix them. |
I meant installing jest in some location and running it to ensure |
Hell yeah 🔥 |
That's the week I'm in Menlo Park 😭😭 But I'd definitely be up to schedule a few hours for a peer coding session to get a better sense of the blockers together! |
Damn, unlucky ^^
Sounds great! I'll drop you a DM / mail next week or so :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once CI passes - Node 6 is probably just a trailing comma thing as usual? 😅
Indeed - should be fixed once #8095 is merged 👍 |
BTW, mind explaining to me why #8095 will fix this? Was there a bug in Yarn 1.13 when using Node 6? |
Not exactly a bug, but PnP wasn't originally tested on Node 6 so the generated |
Which reminds me btw that Yarn 2 will drop compatibility with Node 6, since its official EOL is in April. Will that be a problem? https://github.com/nodejs/Release/blob/master/schedule.svg |
Ah okay, thanks! I couldn't really interpret the CI error 😅
I think we intend to drop it in the next major after the EOL as well, so that should be fine. cc @SimenB |
Timing wise, maaaaaybe. But I wanna press pretty aggressively for Node 8 (so we can stop transpiling |
Windows is failing
|
1cd2475
to
86b09af
Compare
Codecov Report
@@ Coverage Diff @@
## master #8094 +/- ##
==========================================
- Coverage 62.46% 62.45% -0.01%
==========================================
Files 263 264 +1
Lines 10371 10374 +3
Branches 2514 2514
==========================================
+ Hits 6478 6479 +1
- Misses 3317 3318 +1
- Partials 576 577 +1
Continue to review full report at Codecov.
|
Still same error on azure :/ |
@SimenB I'll disable the test on Windows. It's hard to tell without starting a bunch of other runs just to get extra logs, but I think it's simply that on this specific Azure setup the Yarn cache (probably on the user folder in (For the record a more long-term fix is to configure the Yarn cache to be stored on the same disk, for example in the git repository itself, but I think that's a bit heavy for this PR) |
Sounds good |
75c2eb6
to
29cd699
Compare
All green 👍 |
e2e/__tests__/pnp.test.ts
Outdated
|
||
it('sucessfully runs the tests inside `pnp/`', () => { | ||
// https://github.com/facebook/jest/pull/8094#issuecomment-471220694 | ||
if (process.platform !== 'win32') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have a skipOnWindows
helper
import {skipSuiteOnWindows} from '@jest/test-utils';
skipSuiteOnWindows();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can try to add it via GH
I'm having issues with pnp + a I can submit as a new issue if that's better |
A new issue, yes 🙂 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
PnP currently needs an extra plugin to work properly. Adding native would remove friction and strictly improve users' life (since PnP users can't really use Jest without the plugin anyway).
Test plan
I went to implement a e2e test but it proved challenging given the current test infra. The problem is that the tests run on the local Jest build (which makes sense), which doesn't use PnP. It makes it difficult to spawn a e2e test that would use it 😕
So I guess for now the main test is that it doesn't break non-PnP users.