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

expectError finds none, and finds an error... for the same invocation. #170

Closed
igalklebanov opened this issue Nov 15, 2022 · 1 comment · Fixed by #177
Closed

expectError finds none, and finds an error... for the same invocation. #170

igalklebanov opened this issue Nov 15, 2022 · 1 comment · Fixed by #177

Comments

@igalklebanov
Copy link

igalklebanov commented Nov 15, 2022

This one is weird.

expectError is not finding an error & finding an error for the same check.

  test/typings/test-d/update.test-d.ts:42:43
  ✖  42:2   Expected an error, but found none.                                                                                                                                                                                                                                                                                                                                                                                                                                          
  ✖  42:43  Argument of type { readonly first_name: "John"; readonly dinosaurs?: string[]; } is not assignable to parameter of type PickWith<{ readonly first_name: "John"; readonly dinosaurs?: string[]; }, MutationObject<From<Database, "person">, "person", "person">> with exactOptionalPropertyTypes: true. Consider adding undefined to the types of the target's properties.
  Types of property dinosaurs are incompatible.
    Type string[] is not assignable to type never.  

  2 errors

https://github.com/igalklebanov/kysely/blob/tighten-input-objects/test/typings/test-d/update.test-d.ts

also happens after updating tsd to 0.24.1.

removing exactOptionalPropertyTypes: true from test/typings/tsconfig.json makes it pass all tests.

@tommy-mitchell
Copy link
Contributor

This is because tsd doesn't currently support checking for that error (similar to #173). The first error message is because tsd didn't find any errors that it recognizes, and the second is an error reported by the TypeScript compiler that tsd just outputs.

The first error could have a more descriptive message. Related discussion in #177.

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

Successfully merging a pull request may close this issue.

2 participants