Skip to content

Commit ad1fc07

Browse files
committed
Age 2.0.0
1 parent 9eae81d commit ad1fc07

File tree

5 files changed

+31
-23
lines changed

5 files changed

+31
-23
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<a name="2.0.0"></a>
2+
# [2.0.0](https://github.com/faker-javascript/age) (2022-01-09)
3+
4+
### BREAKING CHANGES
5+
6+
* New function `age` istead of `fakeAge`
7+
18
<a name="1.0.0"></a>
29
# [1.0.0](https://github.com/faker-javascript/age) (2022-01-08)
310
* Initial release

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ $ npm install --save @fakerjs/age
1515
## Usage
1616

1717
```js
18-
import fakeAge from '@fakerjs/age';
18+
import age from '@fakerjs/age';
1919

20-
fakeAge();
20+
age();
2121
//=> 42
2222

23-
fakeAge({type: 'child'});
23+
age({type: 'child'});
2424
//=> 10
2525

2626
// Allowed type: child, teen, adult, senior

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function fakeAge(options) {
1+
export default function age(options) {
22
options = options || {};
33
let min = 0;
44
let max = 100;

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fakerjs/age",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "Age package provides functionality to generate a fake age value.",
55
"license": "MIT",
66
"repository": "faker-javascript/age",
@@ -25,6 +25,7 @@
2525
],
2626
"keywords": [
2727
"fakerjs",
28+
"faker",
2829
"fake",
2930
"random",
3031
"age"

test.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
import fakeAge from './index.js';
1+
import age from './index.js';
22
import test from 'ava';
33

4-
test('fakeAge return type to be number', t => {
5-
t.is(typeof fakeAge(), 'number');
4+
test('age return type to be number', t => {
5+
t.is(typeof age(), 'number');
66
});
77

8-
test('fakeAge with type child less than 13 and more than -1', t => {
9-
t.true(fakeAge({type: 'child'}) < 13);
10-
t.true(fakeAge({type: 'child'}) > -1);
8+
test('age with type child less than 13 and more than -1', t => {
9+
t.true(age({type: 'child'}) < 13);
10+
t.true(age({type: 'child'}) > -1);
1111
});
1212

13-
test('fakeAge with type teen less than 20 and more than 12', t => {
14-
t.true(fakeAge({type: 'teen'}) < 20);
15-
t.true(fakeAge({type: 'teen'}) > 12);
13+
test('age with type teen less than 20 and more than 12', t => {
14+
t.true(age({type: 'teen'}) < 20);
15+
t.true(age({type: 'teen'}) > 12);
1616
});
1717

18-
test('fakeAge with type adult less than 69 and more than 17', t => {
19-
t.true(fakeAge({type: 'adult'}) < 69);
20-
t.true(fakeAge({type: 'adult'}) > 17);
18+
test('age with type adult less than 69 and more than 17', t => {
19+
t.true(age({type: 'adult'}) < 69);
20+
t.true(age({type: 'adult'}) > 17);
2121
});
2222

23-
test('fakeAge with type senior less than 101 and more than 64', t => {
24-
t.true(fakeAge({type: 'senior'}) < 101);
25-
t.true(fakeAge({type: 'senior'}) > 64);
23+
test('age with type senior less than 101 and more than 64', t => {
24+
t.true(age({type: 'senior'}) < 101);
25+
t.true(age({type: 'senior'}) > 64);
2626
});
2727

28-
test('fakeAge with type all less than 101 and more than -1', t => {
29-
t.true(fakeAge({type: 'all'}) < 101);
30-
t.true(fakeAge({type: 'all'}) > -1);
28+
test('age with type all less than 101 and more than -1', t => {
29+
t.true(age({type: 'all'}) < 101);
30+
t.true(age({type: 'all'}) > -1);
3131
});

0 commit comments

Comments
 (0)