DefinitelyTyped/types/test-console/test-console-tests.ts
Roberto Soares 9b6cdf78d9 Add types for test-console (#29802)
* @types/test-console: Add types for test-console

* @types/test-console: callbacks as required

* @types/test-console: exporting all types and interfaces
2018-10-17 14:27:05 -07:00

54 lines
1.2 KiB
TypeScript

import { stdout, stderr } from 'test-console';
// $ExpectType Inspector
stdout.inspect();
// $ExpectType Inspector
stdout.inspect({isTTY: true});
// $ExpectError
stdout.inspectSync();
// $ExpectError
stdout.inspectSync({});
// $ExpectType ReadonlyArray<string>
stdout.inspectSync({isTTY: false}, (output) => output);
// $ExpectType Restore
stdout.ignore();
// $ExpectType Restore
stdout.ignore({isTTY: false});
// $ExpectError
stdout.ignoreSync();
// $ExpectType void
stdout.ignoreSync(() => {});
// $ExpectError
stdout.ignoreSync({}, (output) => output);
// $ExpectType void
stdout.ignoreSync({}, () => {});
// $ExpectType Inspector
stderr.inspect();
// $ExpectType Inspector
stderr.inspect({isTTY: true});
// $ExpectError
stderr.inspectSync();
// $ExpectError
stderr.inspectSync({});
// $ExpectType ReadonlyArray<string>
stderr.inspectSync({isTTY: false}, (output) => output);
// $ExpectType Restore
stderr.ignore();
// $ExpectType Restore
stderr.ignore({isTTY: false});
// $ExpectError
stderr.ignoreSync();
// $ExpectType void
stderr.ignoreSync(() => {});
// $ExpectError
stderr.ignoreSync({}, (output) => output);
// $ExpectType void
stderr.ignoreSync({}, () => {});