aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinigami <[email protected]>2022-03-24 17:57:18 +0100
committerGitHub <[email protected]>2022-03-24 17:57:18 +0100
commit7635dc9a63b24b681f88d4029573d0caf8e652b5 (patch)
treea238dacd0149154fa68787564a9150c055cf6218
parentb7b2e4f8dbd40b6bb2678fb60ee95e198838d08a (diff)
downloadfaker-7635dc9a63b24b681f88d4029573d0caf8e652b5.tar.xz
faker-7635dc9a63b24b681f88d4029573d0caf8e652b5.zip
test: remove todo for number conversion (#669)
-rw-r--r--test/commerce.spec.ts6
-rw-r--r--test/finance.spec.ts2
2 files changed, 4 insertions, 4 deletions
diff --git a/test/commerce.spec.ts b/test/commerce.spec.ts
index a06f96ed..3497aa9f 100644
--- a/test/commerce.spec.ts
+++ b/test/commerce.spec.ts
@@ -121,8 +121,7 @@ describe('commerce', () => {
const price = faker.commerce.price();
expect(price).toBeTruthy();
-
- // TODO @Shinigami92 2022-01-20: I converted the price string to number to satisfy TS
+ expect(price).toBeTypeOf('string');
expect(+price).greaterThan(0);
expect(+price).lessThanOrEqual(1000);
});
@@ -154,8 +153,7 @@ describe('commerce', () => {
const amount = faker.commerce.price(-200, -1);
expect(amount).toBeTruthy();
- // TODO @Shinigami92 2022-01-20: I converted the price string to number to satisfy TS
- expect(+amount === 0.0, 'the amount should equal 0').toBe(true);
+ expect(amount, 'the amount should equal 0').toBe('0');
});
it('should handle argument dec', () => {
diff --git a/test/finance.spec.ts b/test/finance.spec.ts
index 312f4fb5..77df6f63 100644
--- a/test/finance.spec.ts
+++ b/test/finance.spec.ts
@@ -205,6 +205,7 @@ describe('finance', () => {
const amount = faker.finance.amount();
expect(amount).toBeTruthy();
+ expect(amount).toBeTypeOf('string');
expect(+amount, 'the amount should be greater than 0').greaterThan(0);
expect(+amount, 'the amount should be less than 1001').lessThan(1001);
});
@@ -234,6 +235,7 @@ describe('finance', () => {
const amount = faker.finance.amount(-200, -1);
expect(amount).toBeTruthy();
+ expect(amount).toBeTypeOf('string');
expect(+amount, 'the amount should be less than 0').lessThan(0);
expect(+amount, 'the amount should be greater than -201').greaterThan(
-201