Skip to content

Commit

Permalink
add additional types tests (#284)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Cousens <dcousens@users.noreply.github.com>
  • Loading branch information
dcousens and dcousens committed Sep 20, 2022
1 parent ee18932 commit 495e24d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 18 additions & 9 deletions tests/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ classNames({ conditional: true });
classNames({ conditional: {} });
classNames({ conditional: Symbol() });
classNames([]);
classNames([['bar', null, undefined, true, false, 1337]]);
classNames(['bar', null, undefined, true, false, 1337]);
classNames('bar', null, undefined, true, false, 1337);
classNames([['bar', null, undefined, true, false, 1234]]);
classNames(['bar', null, undefined, true, false, 1234]);
classNames('bar', null, undefined, true, false, 1234);
classNames('bar', ['abc', { foo: true }]);
classNames('bar', ['abc', { foo: true }], { def: false, ijk: 1234 });
classNames('abc', 1234, true, false, undefined, null, { foo: true }, ['abc', 1234, true, false, undefined, null, { foo: true }]);
// $ExpectError
classNames(Symbol());
// $ExpectError
Expand Down Expand Up @@ -51,9 +54,12 @@ dedupe({ conditional: true });
dedupe({ conditional: {} });
dedupe({ conditional: Symbol() });
dedupe([]);
dedupe([['bar', null, undefined, true, false, 1337]]);
dedupe(['bar', null, undefined, true, false, 1337]);
dedupe('bar', null, undefined, true, false, 1337);
dedupe([['bar', null, undefined, true, false, 1234]]);
dedupe(['bar', null, undefined, true, false, 1234]);
dedupe('bar', null, undefined, true, false, 1234);
dedupe('bar', ['abc', { foo: true }]);
dedupe('bar', ['abc', { foo: true }], { def: false, ijk: 1234 });
dedupe('abc', 1234, true, false, undefined, null, { foo: true }, ['abc', 1234, true, false, undefined, null, { foo: true }]);
// $ExpectError
dedupe(Symbol());
// $ExpectError
Expand All @@ -76,9 +82,12 @@ bound({ conditional: true });
bound({ conditional: {} });
bound({ conditional: Symbol() });
bound([]);
bound([['bar', null, undefined, true, false, 1337]]);
bound(['bar', null, undefined, true, false, 1337]);
bound('bar', null, undefined, true, false, 1337);
bound([['bar', null, undefined, true, false, 1234]]);
bound(['bar', null, undefined, true, false, 1234]);
bound('bar', null, undefined, true, false, 1234);
bound('bar', ['abc', { foo: true }]);
bound('bar', ['abc', { foo: true }], { def: false, ijk: 1234 });
bound('abc', 1234, true, false, undefined, null, { foo: true }, ['abc', 1234, true, false, undefined, null, { foo: true }]);
// $ExpectError
bound(Symbol());
// $ExpectError
Expand Down

0 comments on commit 495e24d

Please sign in to comment.