Skip to content
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

Add missing compilerOptions.lib necessary for tsd-lite to test types consistently #2838

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

jesstelford
Copy link
Contributor

@jesstelford jesstelford commented Sep 18, 2024

Under some circumstances, tsd-lite will throw errors while testing such as:

❯ yarn run jest packages/useful-types/test-d/types.test-d.ts
 FAIL   useful-types  packages/useful-types/test-d/types.test-d.ts
  ✕ tsd typecheck (2562 ms)

  ● tsd typecheck

    Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.

    > 29 |   seenReferences?: WeakMap<object, boolean>,
         |                    ^

      at node_modules/.pnpm/@[email protected]/node_modules/@jest/expect-utils/build/index.d.ts:29:20

I think it has to do with which version of a transitive dependency is installed.

Either way; the compilerOptions.lib option fixes it, and it should have always been there. This PR adds it.

NOTE: I skipped changelog as this is a purely internal test thing only and doesn't require a release.

@jesstelford jesstelford merged commit e4a79ee into main Sep 18, 2024
5 checks passed
@jesstelford jesstelford deleted the add-missing-lib-for-tsd-lite branch September 18, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants