diff options
| author | Edwin Samodra <[email protected]> | 2021-09-11 21:00:27 +0700 |
|---|---|---|
| committer | Edwin Samodra <[email protected]> | 2021-09-11 21:00:27 +0700 |
| commit | a5f25f7fa1027df4b2e522728a3279f7f76e85ff (patch) | |
| tree | 2e1534dc5c59fff80ef21b2529c58ed851ad9b7c /test | |
| parent | 17d56481e3afeabffe9c08c7d932f5e31749f594 (diff) | |
| download | faker-a5f25f7fa1027df4b2e522728a3279f7f76e85ff.tar.xz faker-a5f25f7fa1027df4b2e522728a3279f7f76e85ff.zip | |
rebuild bigInt generator pull request
Diffstat (limited to 'test')
| -rw-r--r-- | test/datatype.unit.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/datatype.unit.js b/test/datatype.unit.js index b206ca47..84a24fd5 100644 --- a/test/datatype.unit.js +++ b/test/datatype.unit.js @@ -286,4 +286,27 @@ describe("datatype.js", function () { });
});
+ describe('bigInt', function () {
+ it('should generate a bigInt value', function () {
+ var generateBigInt = faker.datatype.bigInt();
+ assert.strictEqual(typeof generateBigInt, 'bigint');
+ });
+
+ it('Generate and compare two numbers of data type BigInt, with seeding', function () {
+ faker.seed(123);
+ var generateBigInt1 = faker.datatype.bigInt();
+ faker.seed(123);
+ var generateBigInt2 = faker.datatype.bigInt();
+ assert.strictEqual(generateBigInt1, generateBigInt2);
+ });
+
+ it('summing with the Number datatype should be an error', function(done) {
+ try {
+ faker.datatype.bigInt() + 10
+ } catch (error) {
+ done();
+ }
+ });
+ });
+
});
\ No newline at end of file |
