Skip to content

Commit

Permalink
TS type definitions test improved
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmx committed Jul 1, 2022
1 parent 2980aa0 commit ac22ad5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions human-readable.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
import { availableSizes } from './human-readable';
import { expectType } from 'tsd';
import { availableSizes, fromBytes, calcFromTo, HROptionsType } from './human-readable';

availableSizes();
const testOptions: HROptionsType = {
mode: 'IEC',
numberOnly: false
}

expectType<string[]>(availableSizes());

expectType<string>(fromBytes(1024, testOptions));

expectType<string>(calcFromTo(1024, 'KBYTE', 'MBYTE', undefined));

0 comments on commit ac22ad5

Please sign in to comment.