jest icon indicating copy to clipboard operation
jest copied to clipboard

[Bug]: Type definitions exported by @jest/test-result refer to dev dependency

Open johnameyer opened this issue 1 year ago • 1 comments

Version

29.7.0

Steps to reproduce

  1. npm i @jest/test-result@^29.7.0
  2. Import from package directly or indirectly in a typescript file e.g. echo "import * as testResult from '@jest/test-result';" > index.ts
  3. 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

johnameyer avatar Sep 19 '24 06:09 johnameyer

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.

github-actions[bot] avatar Oct 19 '24 07:10 github-actions[bot]

Happy to take a PR for this 👍

SimenB avatar Oct 20 '24 13:10 SimenB

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.

github-actions[bot] avatar Nov 19 '24 14:11 github-actions[bot]

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.

johnameyer avatar Dec 02 '24 03:12 johnameyer

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.

github-actions[bot] avatar Jan 01 '25 05:01 github-actions[bot]

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.

github-actions[bot] avatar Jan 31 '25 05:01 github-actions[bot]

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.

github-actions[bot] avatar Jan 31 '25 05:01 github-actions[bot]

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.

github-actions[bot] avatar Mar 03 '25 00:03 github-actions[bot]