-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
31 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
<a name="2.0.0"></a> | ||
# [2.0.0](https://github.com/faker-javascript/age) (2022-01-09) | ||
|
||
### BREAKING CHANGES | ||
|
||
* New function `age` istead of `fakeAge` | ||
|
||
<a name="1.0.0"></a> | ||
# [1.0.0](https://github.com/faker-javascript/age) (2022-01-08) | ||
* Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import fakeAge from './index.js'; | ||
import age from './index.js'; | ||
import test from 'ava'; | ||
|
||
test('fakeAge return type to be number', t => { | ||
t.is(typeof fakeAge(), 'number'); | ||
test('age return type to be number', t => { | ||
t.is(typeof age(), 'number'); | ||
}); | ||
|
||
test('fakeAge with type child less than 13 and more than -1', t => { | ||
t.true(fakeAge({type: 'child'}) < 13); | ||
t.true(fakeAge({type: 'child'}) > -1); | ||
test('age with type child less than 13 and more than -1', t => { | ||
t.true(age({type: 'child'}) < 13); | ||
t.true(age({type: 'child'}) > -1); | ||
}); | ||
|
||
test('fakeAge with type teen less than 20 and more than 12', t => { | ||
t.true(fakeAge({type: 'teen'}) < 20); | ||
t.true(fakeAge({type: 'teen'}) > 12); | ||
test('age with type teen less than 20 and more than 12', t => { | ||
t.true(age({type: 'teen'}) < 20); | ||
t.true(age({type: 'teen'}) > 12); | ||
}); | ||
|
||
test('fakeAge with type adult less than 69 and more than 17', t => { | ||
t.true(fakeAge({type: 'adult'}) < 69); | ||
t.true(fakeAge({type: 'adult'}) > 17); | ||
test('age with type adult less than 69 and more than 17', t => { | ||
t.true(age({type: 'adult'}) < 69); | ||
t.true(age({type: 'adult'}) > 17); | ||
}); | ||
|
||
test('fakeAge with type senior less than 101 and more than 64', t => { | ||
t.true(fakeAge({type: 'senior'}) < 101); | ||
t.true(fakeAge({type: 'senior'}) > 64); | ||
test('age with type senior less than 101 and more than 64', t => { | ||
t.true(age({type: 'senior'}) < 101); | ||
t.true(age({type: 'senior'}) > 64); | ||
}); | ||
|
||
test('fakeAge with type all less than 101 and more than -1', t => { | ||
t.true(fakeAge({type: 'all'}) < 101); | ||
t.true(fakeAge({type: 'all'}) > -1); | ||
test('age with type all less than 101 and more than -1', t => { | ||
t.true(age({type: 'all'}) < 101); | ||
t.true(age({type: 'all'}) > -1); | ||
}); |