aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
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");
});
});