-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Remove types for Jest modules #33705
Conversation
Oh btw, |
@SimenB Thank you for submitting this PR! 🔔 @jmreidy @merrywhether @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @JoshuaKGoldberg @UselessPickles @r3nya @Hotell @sebald @andys8 @antoinebrault @lifeiscontent @myabc @theutz @nickmccurdy - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
@sandersn I'm a bit out of my depth on the CI failure 😬 |
@SimenB You need to clone Microsoft/types-publisher and add
|
Cool, thanks! microsoft/types-publisher#589 |
@SimenB OK, I re-ran CI and it looks like there are a couple of errors but they seem to be more to do with linting and correct versions of |
The errors confuse me.
https://unpkg.com/[email protected]/build/index.d.ts I also copied this file into a project of mine and it worked |
Is the tester confused due to https://github.com/DefinitelyTyped/DefinitelyTyped/blob/abbd93ac8dac81fa531e52676dc9b119630fd016/types/expect/index.d.ts being a thing? |
@SimenB The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
Yes. It looks in
I've been meaning to do a cleanup run to remove all |
Should make the |
@SimenB I haven't seen anything from you in a while and this PR currently has problems that prevent it from being merged. The PR will be closed tomorrow if there aren't new commits to fix the issues. |
New release of |
@SimenB The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
A bunch of |
@SimenB All the ones I saw looked like this:
which indicates that I guess that everybody who uses jest-matcher-utils in Typescript without esModuleInterop is seeing this error right now, because neither types are DT types. // @Filename: jest-diff/built/index.d.ts
import { DiffOptions as JestDiffOptions } from './types';
declare function diff(a: any, b: any, options?: JestDiffOptions): string | null;
declare namespace diff {
type DiffOptions = JestDiffOptions;
}
export = diff; // @Filename: jest-matcher-utils/build/index.d.ts
import jestDiff, { DiffOptions } from 'jest-diff'; |
Aha, we use What's preferred, Jest changing to Potentially, we could wait until Jest 25 where we can make breaking changes to the export and use actual ES module exports instead of the hacky half-solution we have now to keep CJS compat |
Well, d.ts files that ship to customers should not assume that they will have |
@SimenB To keep things tidy, we have to close PRs that aren't mergeable but don't have activity from their author. No worries, though - please open a new PR if you'd like to continue with this change. Thank you! |
@SimenB Hey, what's the state on this? We're hitting exactly what was described here: #33705 (comment) Using
|
We'll be changing imports and exports to be esm for jest 25 |
@SimenB Thanks, for the time being we migrated all our project to use Is there an issue for this that I can subscribe to? |
Resurrected in #41837 |
Please fill in this template.
npm test
.)npm run lint package-name
(ortsc
if notslint.json
is present).If removing a declaration:
notNeededPackages.json
.Jest 24.3.0 has been released, and is completely rewritten to TypeScript, and distributes types. There might be subtle differences between the ones in this repo and the official ones, but I'm hopeful people will PR us the changes they need 🙂
Not sure what this means for
DefinitelyTyped/types/jest/index.d.ts
Line 24 in 442b0dd
Does it need a
package.json
now?EDIT: CI failed without it, so added one
One thing to note is that
expect
also has typings, but theexpect
typings in this repo is for https://github.com/mjackson/expect, not the one fromjest
. However, theexpect
typings do not include any actual matchers, so we should fix that first