aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarak <[email protected]>2020-06-10 00:12:30 -0500
committerGitHub <[email protected]>2020-06-10 00:12:30 -0500
commitab45902e8ef4daedb0fd9d6777896ca0446c4d01 (patch)
tree1342d690760fdacc13e5e8700403ac24fb616e79 /test
parent426544883d8a571c84ec1f5093d006516f854bf4 (diff)
parent11f94b386a0edc686213e34772e8d1694b0bdcdd (diff)
downloadfaker-ab45902e8ef4daedb0fd9d6777896ca0446c4d01.tar.xz
faker-ab45902e8ef4daedb0fd9d6777896ca0446c4d01.zip
Merge pull request #887 from edumoreira1506/fix/amount-return-number
Fix return of finance.amount
Diffstat (limited to 'test')
-rw-r--r--test/finance.unit.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/test/finance.unit.js b/test/finance.unit.js
index 6c1cb142..432a9332 100644
--- a/test/finance.unit.js
+++ b/test/finance.unit.js
@@ -160,9 +160,9 @@ describe('finance.js', function () {
});
- it("should use the defaul decimal location when not passing arguments", function () {
+ it("should use the default decimal location when not passing arguments", function () {
- var amount = faker.finance.amount();
+ var amount = faker.finance.amount().toString();
var decimal = '.';
var expected = amount.length - 3;
@@ -200,7 +200,7 @@ describe('finance.js', function () {
var amount = faker.finance.amount(100, 100, 1);
assert.ok(amount);
- assert.strictEqual(amount , '100.0', "the amount should be equal 100.0");
+ assert.strictEqual(amount , 100.0, "the amount should be equal 100.0");
});
it("it should handle argument dec = 0", function () {
@@ -208,7 +208,17 @@ describe('finance.js', function () {
var amount = faker.finance.amount(100, 100, 0);
assert.ok(amount);
- assert.strictEqual(amount , '100', "the amount should be equal 100");
+ assert.strictEqual(amount , 100, "the amount should be equal 100");
+ });
+
+ it("it should return a number", function() {
+
+ var amount = faker.finance.amount(100, 100, 0);
+
+ var typeOfAmount = typeof amount;
+
+ assert.ok(amount);
+ assert.strictEqual(typeOfAmount , 'number', "the amount type should be number");
});
});