-
-
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
fix(jest-types): compat with @types/node v16 #11645
Conversation
Hi @splincode! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
CLA signed |
Codecov Report
@@ Coverage Diff @@
## master #11645 +/- ##
=======================================
Coverage 69.01% 69.01%
=======================================
Files 312 312
Lines 16335 16335
Branches 4734 4734
=======================================
Hits 11273 11273
Misses 5034 5034
Partials 28 28
Continue to review full report at Codecov.
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
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.
Our CI picked up a few other references across the packages:
node_modules/@jest/console/build/BufferedConsole.d.ts(15,21): error TS2694: Namespace 'NodeJS' has no exported member 'ConsoleConstructor'.
node_modules/@jest/console/build/BufferedConsole.d.ts(23,45): error TS2694: Namespace 'NodeJS' has no exported member 'InspectOptions'.
node_modules/@jest/console/build/CustomConsole.d.ts(18,21): error TS2694: Namespace 'NodeJS' has no exported member 'ConsoleConstructor'.
node_modules/@jest/console/build/CustomConsole.d.ts(26,45): error TS2694: Namespace 'NodeJS' has no exported member 'InspectOptions'.
node_modules/@jest/fake-timers/build/legacyFakeTimers.d.ts(15,43): error TS2694: Namespace 'NodeJS' has no exported member 'Global'.
node_modules/@jest/fake-timers/build/modernFakeTimers.d.ts(17,24): error TS2694: Namespace 'NodeJS' has no exported member 'Global'.
node_modules/@jest/types/build/Config.d.ts(312,38): error TS2694: Namespace 'NodeJS' has no exported member 'Global'.
node_modules/@jest/types/build/Global.d.ts(93,62): error TS2694: Namespace 'NodeJS' has no exported member 'Global'.
node_modules/jest-mock/build/index.d.ts(8,30): error TS2694: Namespace 'NodeJS' has no exported member 'Global'.
@72636c hi, fixed )) |
Can a maintainer please provide an update on this? This is causing ecosystem-wide disruption. I've documented only a few instances here. Also, what is being done to ensure that this does not occur again in the future? |
Having issues with ts checking too with errors: Namespace 'NodeJS' has no exported member 'ConsoleConstructor' |
@SimenB bump, status? |
@cpojer please review. |
Any updates for this fix? |
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.
Thanks! Could you add a changelog entry?
Also, weird that GH Actions hasn't triggered... Maybe a new commit with a changelog fixes it 🙂
|
Add an entry here describing your change: https://github.com/facebook/jest/blob/master/CHANGELOG.md |
ae8f09c
to
cd4511d
Compare
@SimenB hello, I was updated branch, please review me |
@SimenB hello, I was updated branch after review)) |
Thanks @splincode! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Is this a breaking change? it seems like export interface Global extends GlobalAdditions, Omit<typeof globalThis, keyof GlobalAdditions> {
[extras: string]: unknown;
} breaking our existing declaration of variables set to declare global {
namespace NodeJS {
interface Global {
driver: TestDriver;
reset(): Promise<void>;
}
}
}
class ITEnvironment extends NodeEnvironment {
async setup(): Promise<void> {
await super.setup();
this.global.driver = new TestDriver(...);
this.global.reset = async () => {
await this.global.driver.reset();
};
}
}
... that used to work fine until now, but now we're getting: error TS2571: Object is of type 'unknown'.
await this.global.driver.reset();
~~~~~~~~~~~~~~~~~~ with jest Is this by design? are typed exports from |
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. |
#11640