Skip to content

Commit

Permalink
Replace deprecated faker.name with faker.person (#4581)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashohn authored Nov 14, 2024
1 parent 39b0311 commit 740506a
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ var Factory = require('rosie').Factory;
var faker = require('@faker-js/faker');

module.exports = new Factory()
.attr('name', () => faker.name.findName())
.attr('name', () => faker.person.findName())
.attr('email', () => faker.internet.email());
```

Expand Down Expand Up @@ -271,7 +271,7 @@ module.exports = new Factory((buildObj) => {
input: { ...buildObj },
}
})
.attr('name', () => faker.name.findName())
.attr('name', () => faker.person.findName())
.attr('email', () => faker.internet.email());
```

Expand Down
2 changes: 1 addition & 1 deletion docs/helpers/ApiDataFactory.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const { faker } = require('@faker-js/faker');

module.exports = new Factory()
// no need to set id, it will be set by REST API
.attr('author', () => faker.name.findName())
.attr('author', () => faker.person.findName())
.attr('title', () => faker.lorem.sentence())
.attr('body', () => faker.lorem.paragraph());
```
Expand Down
2 changes: 1 addition & 1 deletion docs/helpers/GraphQLDataFactory.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module.exports = new Factory((buildObj) => ({
input: { ...buildObj },
}))
// 'attr'-id can be left out depending on the GraphQl resolvers
.attr('name', () => faker.name.findName())
.attr('name', () => faker.person.findName())
.attr('email', () => faker.interact.email())
```

Expand Down
2 changes: 1 addition & 1 deletion lib/helper/ApiDataFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const REST = require('./REST')
*
* module.exports = new Factory()
* // no need to set id, it will be set by REST API
* .attr('author', () => faker.name.findName())
* .attr('author', () => faker.person.findName())
* .attr('title', () => faker.lorem.sentence())
* .attr('body', () => faker.lorem.paragraph());
* ```
Expand Down
2 changes: 1 addition & 1 deletion lib/helper/GraphQLDataFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const GraphQL = require('./GraphQL')
* input: { ...buildObj },
* }))
* // 'attr'-id can be left out depending on the GraphQl resolvers
* .attr('name', () => faker.name.findName())
* .attr('name', () => faker.person.findName())
* .attr('email', () => faker.interact.email())
* ```
* For more options see [rosie documentation](https://github.com/rosiejs/rosie).
Expand Down
2 changes: 1 addition & 1 deletion test/data/graphql/users_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ const { faker } = require('@faker-js/faker');
module.exports = new Factory(function (buildObject) {
this.input = { ...buildObject };
})
.attr('name', () => faker.name.fullName())
.attr('name', () => faker.person.fullName())
.attr('email', () => faker.internet.email());
2 changes: 1 addition & 1 deletion test/data/rest/posts_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ const { Factory } = require('rosie');
const { faker } = require('@faker-js/faker');

module.exports = new Factory()
.attr('author', () => faker.name.fullName())
.attr('author', () => faker.person.fullName())
.attr('title', () => faker.lorem.sentence())
.attr('body', () => faker.lorem.paragraph());

0 comments on commit 740506a

Please sign in to comment.