[Bug]: Type definitions exported by @jest/test-result refer to dev dependency
Version
29.7.0
Steps to reproduce
npm i @jest/test-result@^29.7.0- Import from package directly or indirectly in a typescript file e.g.
echo "import * as testResult from '@jest/test-result';" > index.ts - Attempt to compile
npx tsc index.ts
https://stackblitz.com/edit/node-my9zod?file=index.ts,package.json,package-lock.json
(Real use case) https://stackblitz.com/edit/node-ru6fy9?file=index.ts,package.json
Expected behavior
No Typescript compilation errors
Actual behavior
Typescript error thrown
node_modules/@jest/test-result/build/index.d.ts:14:27 - error TS2307: Cannot find module 'jest-resolve' or its corresponding type declarations.
14 import type Resolver from 'jest-resolve';
~~~~~~~~~~~~~~
Found 1 error in ../../node_modules/.pnpm/@[email protected]/node_modules/@jest/test-result/build/index.d.ts:14
Additional context
The type declarations of https://www.npmjs.com/package/@jest/test-result import from 'jest-resolve' despite it only being depended on as a dev dependency.
Environment
System:
OS: Linux 5.0 undefined
CPU: (6) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Binaries:
Node: 18.20.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
Happy to take a PR for this 👍
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
Is it possible to prevent this issue from becoming stale?
I haven't had a chance to look at resolving but it still remains an issue.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.