-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
TagawaHirotaka
authored
Jun 5, 2021
1 parent
909b670
commit 0441b98
Showing
5 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {Predicate, PredicateOptions} from './predicate'; | ||
|
||
export class BigIntPredicate extends Predicate<bigint> { | ||
/** | ||
@hidden | ||
*/ | ||
constructor(options?: PredicateOptions) { | ||
super('bigint', options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import test from 'ava'; | ||
import ow from '../source'; | ||
|
||
test('bigint', t => { | ||
t.notThrows(() => { | ||
// eslint-disable-next-line node/no-unsupported-features/es-builtins | ||
ow(BigInt(9007199254740991), ow.bigint); | ||
}); | ||
|
||
t.notThrows(() => { | ||
// eslint-disable-next-line node/no-unsupported-features/es-syntax | ||
ow(9007199254740991n, ow.bigint); | ||
}); | ||
|
||
t.throws(() => { | ||
ow(10, ow.bigint); | ||
}, 'Expected argument to be of type `bigint` but received type `number`'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters