Skip to content

Commit

Permalink
tests ~ add exemplar side-by-side unit test for OSPaths
Browse files Browse the repository at this point in the history
  • Loading branch information
rivy committed Dec 28, 2020
1 parent 39c5d6a commit 8104bfd
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/lib/OSPaths.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import test from 'ava';

import module_ from '..';

type moduleInternals_ = typeof module_ & {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
readonly [index: string]: (_dirOptions?: any) => any;
};

test('api', (t) => {
const paths = module_;
const api = ['home', 'temp'];

t.is(typeof paths, 'function');
t.is(Object.keys(paths).length, api.length);
api.forEach((key) => {
t.is(typeof (paths as moduleInternals_)[key], 'function');
});
});

0 comments on commit 8104bfd

Please sign in to comment.