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

Upgrade Jest to fix "Interface 'JestImportMeta' incorrectly extends interface 'ImportMeta'." #6

Closed
ezzatron opened this issue May 10, 2023 · 1 comment

Comments

@ezzatron
Copy link
Owner

Example error: https://github.com/eloquent/austenite/actions/runs/4936718660/jobs/8824596203#step:5:39

yarn exec --silent -- tsc --noEmit
Error: node_modules/@jest/environment/build/index.d.ts(401,26): error TS2430: Interface 'JestImportMeta' incorrectly extends interface 'ImportMeta'.
  The types of 'jest.replaceProperty' are incompatible between these types.
    Type '<T extends object, K extends Exclude<keyof T, keyof { [K in keyof T as Required<T>[K] extends ClassLike ? K : never]: T[K]; } | keyof { [K in keyof T as Required<T>[K] extends FunctionLike ? K : never]: T[K]; }>, V extends T[K]>(object: T, propertyKey: K, value: V) => Replaced<...>' is not assignable to type '<T extends object, K extends keyof T>(obj: T, key: K, value: T[K]) => ReplaceProperty<T[K]>'.
      Types of parameters 'propertyKey' and 'key' are incompatible.
        Type 'K' is not assignable to type 'Exclude<keyof T, keyof { [K in keyof T as Required<T>[K] extends ClassLike ? K : never]: T[K]; } | keyof { [K in keyof T as Required<T>[K] extends FunctionLike ? K : never]: T[K]; }>'.
          Type 'keyof T' is not assignable to type 'Exclude<keyof T, keyof { [K in keyof T as Required<T>[K] extends ClassLike ? K : never]: T[K]; } | keyof { [K in keyof T as Required<T>[K] extends FunctionLike ? K : never]: T[K]; }>'.
            Type 'string | number | symbol' is not assignable to type 'Exclude<keyof T, keyof { [K in keyof T as Required<T>[K] extends ClassLike ? K : never]: T[K]; } | keyof { [K in keyof T as Required<T>[K] extends FunctionLike ? K : never]: T[K]; }>'.
              Type 'string' is not assignable to type 'Exclude<keyof T, keyof { [K in keyof T as Required<T>[K] extends ClassLike ? K : never]: T[K]; } | keyof { [K in keyof T as Required<T>[K] extends FunctionLike ? K : never]: T[K]; }>'.
make: *** [.makefiles/pkg/js/v1/with-tsc.mk:4: tsc-typecheck] Error 2

Should be fixed in jestjs/jest#14008 - just waiting on a new Jest release.

@ezzatron
Copy link
Owner Author

ezzatron commented Jul 8, 2023

This is now fixed.

@ezzatron ezzatron closed this as completed Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant