0.3.2 • Published 7 years ago
typings-tester v0.3.2
Typings Tester  
 
A library aimed to aid testing of TypeScript definitions. Checks TypeScript files for syntactic, expected and unexpected semantic (type) errors.
Installation
$ npm install -D typings-testerAny version of TypeScript must be installed separately.
CLI Usage
$ typings-tester --config path/to/tsconfig.json **/*.ts
 
$ typings-tester --dir path/to/directoryAPI Usage
import test from "tape";
import {check, checkDirectory} from "typings-tester";
test('typings', assert => {
  assert.doesNotThrow(() => check(['test.ts'], 'tsconfig.json'));
  
  assert.doesNotThrow(() => checkDirectory('src'));
});Flags
- typings:expect-error: expect next line or block to contain semantic error.- typings-testerwill fail if no error is produced.
// typings:expect-error
function shouldFail(a: number): string {
  return a;
}What's next
- Testing against multiple versions of TypeScript
- Inferred type assertions