Skip to content

Commit

Permalink
updated faker version
Browse files Browse the repository at this point in the history
  • Loading branch information
iBrianWarner committed Apr 8, 2024
1 parent 9906f15 commit 1fb83b9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ App for testing: `https://react-redux.realworld.io`
1. Click on [Sign up] button.
1. Assert your username appeared in site navigation (header) menu.

To install `faker` plugin, run the command: `npm install [email protected]`.
To use `faker` in your tests, go to `support`/`generate.js` file and write the next code:

```js
const faker = require('faker');
import { faker } from '@faker-js/faker';

function generateUser() {
const randomNumber = Math.random().toString().slice(2, 6);
Expand All @@ -43,7 +42,7 @@ module.exports = { generateUser };
Now, you can generate a new user in your tests:

```js
const { generateUser } = require('../support/generate');
import { generateUser } from '../support/generate';

describe('Sign Up page', () => {
it('should provide an ability to register new account', () => {
Expand Down
11 changes: 6 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
"dependencies": {
"cypress-image-snapshot": "^4.0.1",
"eslint-plugin-cypress": "^2.12.1",
"faker": "^5.5.3",
"pg": "^8.9.0",
"sequelize": "^6.21.2",
"sequelize-cli": "^6.4.1"
"sequelize-cli": "^6.4.1",
"@faker-js/faker": "^8.4.1"
},
"devDependencies": {
"@faker-js/faker": "^8.4.1",
"@types/cypress": "latest",
"@typescript-eslint/eslint-plugin": "^5.52.0",
"@typescript-eslint/parser": "^5.52.0",
Expand Down

0 comments on commit 1fb83b9

Please sign in to comment.