aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/commerce.unit.js17
-rw-r--r--test/finance.unit.js18
2 files changed, 34 insertions, 1 deletions
diff --git a/test/commerce.unit.js b/test/commerce.unit.js
index 06445e34..12b06887 100644
--- a/test/commerce.unit.js
+++ b/test/commerce.unit.js
@@ -110,6 +110,23 @@ describe("commerce.js", function() {
assert.ok(amount);
assert.equal((amount == 0.00), true, "the amount should equal 0");
});
+
+ it("it should handle argument dec", function () {
+
+ var price = faker.commerce.price(100, 100, 1);
+
+ assert.ok(price);
+ assert.strictEqual(price , '100.0', "the price should be equal 100.0");
+ });
+
+ it("it should handle argument dec = 0", function () {
+
+ var price = faker.commerce.price(100, 100, 0);
+
+ assert.ok(price);
+ assert.strictEqual(price , '100', "the price should be equal 100");
+ });
+
});
}); \ No newline at end of file
diff --git a/test/finance.unit.js b/test/finance.unit.js
index 6bbb51c6..22461f22 100644
--- a/test/finance.unit.js
+++ b/test/finance.unit.js
@@ -184,6 +184,22 @@ describe('finance.js', function () {
});
+ it("it should handle argument dec", function () {
+
+ var amount = faker.finance.amount(100, 100, 1);
+
+ assert.ok(amount);
+ assert.strictEqual(amount , '100.0', "the amount should be equal 100.0");
+ });
+
+ it("it should handle argument dec = 0", function () {
+
+ var amount = faker.finance.amount(100, 100, 0);
+
+ assert.ok(amount);
+ assert.strictEqual(amount , '100', "the amount should be equal 100");
+ });
+
});
describe('transactionType()', function () {
@@ -201,7 +217,7 @@ describe('finance.js', function () {
assert.ok(currencyCode.match(/[A-Z]{3}/));
});
- })
+ });
describe("bitcoinAddress()", function(){
it("returns a random bitcoin address", function(){