-
-
Notifications
You must be signed in to change notification settings - Fork 696
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 typescript definitions to chai #822
Conversation
@unional Oh, I completely forgot about https://github.com/types/npm-chai. Do you know if it's more up-to-date than DefinitelyTyped? I've been using DT for a long time, nothing to complain about it. |
No problem. |
@goenning thanks a bunch for this PR! Still interested in taking this in, but right now we're focussing on a 4.0 release. I'll leave this PR open, but we won't merge until 4.0 has been released. |
@goenning you'll want to update these with the latest definitions. https://github.com/DefinitelyTyped/DefinitelyTyped/tree/40354debb1db20dd93f52ffe6394bb5a310109a1/types/chai |
Do you need some help with this? I'm a |
@demurgos that would be excellent! Now we're past the 4.0 release we can start focussing on PRs like this. Getting the types here up to date with the current API would be a first priority; as well as that if we could have someone from the TS community confirm that how we would distribute these is the correct way to go, then I'm very happy to get this in for a new minor release. |
Hey! Wondering what's blocking review/approval on this? I think it would be great for chai to provide its own typings. Is it just updating the type definitions to match the v4+ api? |
Yes I'd like to make sure before we ago ahead with this, that we get it up to date with the v4 API, so that it can be used right away. |
Hey folks, how are we on this? I'm thinking about doing my best to close/merge open PRs so that we can move forward in a better way. Let me know if y'all need any help with this. |
Sorry, I haven't had much time to look into this but I may look at it in the next days. |
I have initially created this PR, but haven’t got time to push it forward. Sorry about that. |
I'll go ahead and make a new one now... |
@JoshuaKGoldberg if you are making a new one, would it make sense to get rid of the |
@unional I'm copying from DefinitelyTyped and not seeing them there or on types/npm-chai. Am I missing something? |
Nevermind, I think it will be way too much work to change the typings in DT I mean the interfaces: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/index.d.ts#L256 Arrh.... I was mixing up lodash and chai.... sorry, it is late at night. |
Thanks very much for all of your work here @goenning! It looks like @JoshuaKGoldberg has picked this up in #1092 and so I'll close this one and we can focus on #1092. Hopefully the next minor release of chai will come with typescript definitions 🎉 |
This commit adds type definitions for Chai. These type definitions are based on the types from DefinitelyTyped. They enable Typescript users to use the library directly and serve as documentation. The main changes from the DT version are: - Use external module style - Use `AssertionError` types from `assertion-error` - Fix global modification of objects with `should` The types can be improved in further PRs. This commit also adds tests for the type definitions. It tries to compile (in noEmit mode) the files in `test/typings` using the type definitions. This adds `typescript` as a new dev dependency. For maintenance and semver, the types should be treated as documentation. They should be kept up-to-date with the code, especially when breaking changes occur (wrong documentation is worse than incomplete documentation), see discussion in chaijs#1092. [Help for type definitions][ts-declarations] - Closes chaijs#650 (original issue) - See chaijs#822 (previous PR with merge conflicts) - Closes chaijs#1092 (superseded by this PR) [ts-declarations]: https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html
This commit adds type definitions for Chai. These type definitions are based on the types from DefinitelyTyped. They enable Typescript users to use the library directly and serve as documentation. The main changes from the DT version are: - Use external module style - Use `AssertionError` types from `assertion-error` - Fix global modification of objects with `should` The types can be improved in further PRs. This commit also adds tests for the type definitions. It tries to compile (in noEmit mode) the files in `test/typings` using the type definitions. This adds `typescript` as a new dev dependency. For maintenance and semver, the types should be treated as documentation. They should be kept up-to-date with the code, especially when breaking changes occur (wrong documentation is worse than incomplete documentation), see discussion in chaijs#1092. [Help for type definitions][ts-declarations] - Closes chaijs#650 (original issue) - See chaijs#822 (previous PR with merge conflicts) - Closes chaijs#1092 (superseded by this PR) [ts-declarations]: https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html
I've been using chai with all my TypeScript projects and having the Chai core team maintaining the definitions would be perffect.
@keithamus are you still interested on it?
This PR includes both the definitions and test cases. It's basically a copy from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/chai
This PR should close /issues/650 and typed-typings/npm-chai/issues/14