Unit tests for .d.ts TypeScript definitions
npm install check-dtsUnit tests for .d.ts TypeScript definitions in your JavaScript
open source library.
It is useful for non-TypeScript project, which wants to provide typing
support for TypeScript users and autocompletion for IDE and text editors.
It becomes especially useful for complex types with generics, like we have
in [Nano Events] or [Storeon].
``ts
// Negative test: test/index.errors.ts
import lib = require('../')
interface Events {
'set': (a: string, b: number) => void
}
// THROWS Expected 3 arguments, but got 2
lib.on
`
`ts
// Positive test: test/index.types.ts
import lib = require('../')
interface Events {
'set': (a: string, b: number) => void
}
lib.on
``
[Nano Events]: https://github.com/ai/nanoevents/#typescript
[Storeon]: https://github.com/storeon/storeon#typescript

alt="Sponsored by Evil Martians" width="236" height="54">