diff options
| author | alexpts <[email protected]> | 2017-02-11 09:24:12 +0300 |
|---|---|---|
| committer | alexpts <[email protected]> | 2017-02-11 09:24:12 +0300 |
| commit | 434b3174b1cd3cf568c06aefbc2e8d000b397adf (patch) | |
| tree | c64b1370e709bbf8a1442f981366b4209e209232 /test/commerce.unit.js | |
| parent | 1df4877133afd18c65d187475872c2c52e508803 (diff) | |
| download | faker-434b3174b1cd3cf568c06aefbc2e8d000b397adf.tar.xz faker-434b3174b1cd3cf568c06aefbc2e8d000b397adf.zip | |
Fix aomount and price argument dec for case = 0. Add unit tests. Minor codestyle fix.
Diffstat (limited to 'test/commerce.unit.js')
| -rw-r--r-- | test/commerce.unit.js | 17 |
1 files changed, 17 insertions, 0 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 |
