Skip to content

Commit 740506a

Browse files
authored
Replace deprecated faker.name with faker.person (#4581)
1 parent 39b0311 commit 740506a

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

docs/data.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ var Factory = require('rosie').Factory;
211211
var faker = require('@faker-js/faker');
212212

213213
module.exports = new Factory()
214-
.attr('name', () => faker.name.findName())
214+
.attr('name', () => faker.person.findName())
215215
.attr('email', () => faker.internet.email());
216216
```
217217

@@ -271,7 +271,7 @@ module.exports = new Factory((buildObj) => {
271271
input: { ...buildObj },
272272
}
273273
})
274-
.attr('name', () => faker.name.findName())
274+
.attr('name', () => faker.person.findName())
275275
.attr('email', () => faker.internet.email());
276276
```
277277

docs/helpers/ApiDataFactory.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const { faker } = require('@faker-js/faker');
5858

5959
module.exports = new Factory()
6060
// no need to set id, it will be set by REST API
61-
.attr('author', () => faker.name.findName())
61+
.attr('author', () => faker.person.findName())
6262
.attr('title', () => faker.lorem.sentence())
6363
.attr('body', () => faker.lorem.paragraph());
6464
```

docs/helpers/GraphQLDataFactory.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = new Factory((buildObj) => ({
6262
input: { ...buildObj },
6363
}))
6464
// 'attr'-id can be left out depending on the GraphQl resolvers
65-
.attr('name', () => faker.name.findName())
65+
.attr('name', () => faker.person.findName())
6666
.attr('email', () => faker.interact.email())
6767
```
6868

lib/helper/ApiDataFactory.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const REST = require('./REST')
5151
*
5252
* module.exports = new Factory()
5353
* // no need to set id, it will be set by REST API
54-
* .attr('author', () => faker.name.findName())
54+
* .attr('author', () => faker.person.findName())
5555
* .attr('title', () => faker.lorem.sentence())
5656
* .attr('body', () => faker.lorem.paragraph());
5757
* ```

lib/helper/GraphQLDataFactory.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const GraphQL = require('./GraphQL')
5555
* input: { ...buildObj },
5656
* }))
5757
* // 'attr'-id can be left out depending on the GraphQl resolvers
58-
* .attr('name', () => faker.name.findName())
58+
* .attr('name', () => faker.person.findName())
5959
* .attr('email', () => faker.interact.email())
6060
* ```
6161
* For more options see [rosie documentation](https://github.com/rosiejs/rosie).

test/data/graphql/users_factory.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ const { faker } = require('@faker-js/faker');
44
module.exports = new Factory(function (buildObject) {
55
this.input = { ...buildObject };
66
})
7-
.attr('name', () => faker.name.fullName())
7+
.attr('name', () => faker.person.fullName())
88
.attr('email', () => faker.internet.email());

test/data/rest/posts_factory.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ const { Factory } = require('rosie');
22
const { faker } = require('@faker-js/faker');
33

44
module.exports = new Factory()
5-
.attr('author', () => faker.name.fullName())
5+
.attr('author', () => faker.person.fullName())
66
.attr('title', () => faker.lorem.sentence())
77
.attr('body', () => faker.lorem.paragraph());

0 commit comments

Comments
 (0)