会有@types/jest 版本 27 吗?

Will there be a @types/jest version 27?

我见过的所有其他 Jest 相关包都是版本 27,除了这个。我不确定这是不是故意的。 Jest 文档 states

For @types/* modules it's recommended to try to match the version of the associated module. For example, if you are using 26.4.0 of jest then using 26.4.x of @types/jest is ideal. In general, try to match the major (26) and minor (4) version as closely as possible.

我不确定是否通过确保 @jest/globals 已准备好用作 DefinitelyTyped 中的依赖项来阻止 27 工作(如果我正确理解 PR discussion)。或者是因为 27 版本不需要更改类型(对我来说似乎不太可能)。也许只是还没有人知道。

如果这只是一个还没有人接触到它的情况,作为后续行动,是否有一种简单的方法可以知道哪些类型需要更新?

是的,DefinitelyTyped 与 Jest 无关。实际上 DefinitelyTyped 是由 Microsoft 的 TypeScript 团队成员维护的,当然还有很多志愿者。

DefinitelyTyped 中的类型记录了 JavaScript 库的外部 API。

要查看发生了什么变化,必须比较 APIs:

此处的更改日志中提供了更改列表:https://github.com/facebook/jest/blob/master/CHANGELOG.md#2700

必须浏览所有这些内容并相应地更新类型。

开玩笑的人确认 44365 没有阻止@types/jest 27。但是他们不知道@types/jest 更新的状态。我不相信任何 Jest 贡献者也是 Jest DefinitelyTyped 贡献者。

A question posted in GitHub confirmed that this was just a case of the update not being done yet. But there is now a pull request 更新类型。

Krisztián Balla 的 描述了如何查找可能需要更改类型的版本之间的更改。不幸的是,没有更简单的方法可以做到这一点,而且您无处可以了解 Jest DefinitelyTyped 的维护者是否预计会有任何更改。