parent
587a5fbcbb
commit
85f99bb677
4 changed files with 43 additions and 1 deletions
27
stderr.test-d.ts
Normal file
27
stderr.test-d.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import {expectType} from 'tsd-check';
|
||||
import cherr, {Level, Chalk, ColorSupport} from './stderr';
|
||||
|
||||
// - Helpers -
|
||||
type colorReturn = Chalk & {supportsColor: ColorSupport};
|
||||
|
||||
// - supportsColor -
|
||||
expectType<boolean>(cherr.supportsColor.hasBasic);
|
||||
expectType<boolean>(cherr.supportsColor.has256);
|
||||
expectType<boolean>(cherr.supportsColor.has16m);
|
||||
|
||||
// - Chalk -
|
||||
// -- Constructor --
|
||||
expectType<Chalk>(new cherr.constructor({level: 1}));
|
||||
|
||||
// -- Properties --
|
||||
expectType<boolean>(cherr.enabled);
|
||||
expectType<Level>(cherr.level);
|
||||
|
||||
// -- Template literal --
|
||||
expectType<string>(cherr``);
|
||||
|
||||
// -- Color methods --
|
||||
expectType<colorReturn>(cherr.hex('#DEADED'));
|
||||
|
||||
// -- Complex --
|
||||
expectType<string>(cherr.underline.red.bgGreen('foo'));
|
||||
Loading…
Add table
Add a link
Reference in a new issue