From 33d2e6d1effd053870686d960ad25ef2f24f95b9 Mon Sep 17 00:00:00 2001 From: Walmyr Date: Sun, 15 Sep 2024 01:21:47 +0200 Subject: [PATCH] Upgrade faker-js and adjust tests due to breaking changes --- cypress/e2e/gui/group/createGroup.cy.js | 2 +- cypress/e2e/gui/group/createGroupLabel.cy.js | 2 +- cypress/e2e/gui/project/commentOnIssue.cy.js | 2 +- cypress/e2e/gui/project/createIssue.cy.js | 4 ++-- cypress/e2e/gui/project/createNewFile.cy.js | 4 ++-- cypress/e2e/gui/project/createProject.cy.js | 2 +- cypress/e2e/gui/project/createWiki.cy.js | 2 +- cypress/e2e/gui/project/issueMilestone.cy.js | 2 +- cypress/e2e/gui/project/labelAnIssue.cy.js | 2 +- cypress/e2e/gui/project/starProject.cy.js | 4 ++-- package-lock.json | 18 +++++++++--------- package.json | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/cypress/e2e/gui/group/createGroup.cy.js b/cypress/e2e/gui/group/createGroup.cy.js index bd71ae1..40be7c4 100644 --- a/cypress/e2e/gui/group/createGroup.cy.js +++ b/cypress/e2e/gui/group/createGroup.cy.js @@ -9,7 +9,7 @@ describe('Group', () => { it('creates a group', () => { const group = { name: `group-${faker.string.uuid()}`, - description: faker.random.words(5) + description: faker.word.words(5) } cy.gui_createPublicGroup(group) diff --git a/cypress/e2e/gui/group/createGroupLabel.cy.js b/cypress/e2e/gui/group/createGroupLabel.cy.js index 9ee02e0..1b3960b 100644 --- a/cypress/e2e/gui/group/createGroupLabel.cy.js +++ b/cypress/e2e/gui/group/createGroupLabel.cy.js @@ -6,7 +6,7 @@ describe('Group Label', () => { name: `group-${randomUuid}`, path: randomUuid, label: { - title: `label-${faker.random.word()}` + title: `label-${faker.word.sample()}` } } diff --git a/cypress/e2e/gui/project/commentOnIssue.cy.js b/cypress/e2e/gui/project/commentOnIssue.cy.js index b4eb5ff..b26a500 100644 --- a/cypress/e2e/gui/project/commentOnIssue.cy.js +++ b/cypress/e2e/gui/project/commentOnIssue.cy.js @@ -11,7 +11,7 @@ describe('Issue', () => { }) it('comments on an issue', function () { - const comment = faker.random.words(3) + const comment = faker.word.words(3) const { name: projectName } = this.projectsBody[0] const { iid: issueIid } = this.issue.body diff --git a/cypress/e2e/gui/project/createIssue.cy.js b/cypress/e2e/gui/project/createIssue.cy.js index 1e22d17..c351212 100644 --- a/cypress/e2e/gui/project/createIssue.cy.js +++ b/cypress/e2e/gui/project/createIssue.cy.js @@ -3,10 +3,10 @@ import { faker } from '@faker-js/faker/locale/en' describe('Issue', () => { const project = { name: `project-${faker.string.uuid()}`, - description: faker.random.words(5), + description: faker.word.words(5), issue: { title: `issue-${faker.string.uuid()}`, - description: faker.random.words(3) + description: faker.word.words(3) } } diff --git a/cypress/e2e/gui/project/createNewFile.cy.js b/cypress/e2e/gui/project/createNewFile.cy.js index 1bcdade..c23878f 100644 --- a/cypress/e2e/gui/project/createNewFile.cy.js +++ b/cypress/e2e/gui/project/createNewFile.cy.js @@ -4,8 +4,8 @@ describe('File', () => { const project = { name: `project-${faker.string.uuid()}`, file: { - name: `${faker.random.word()}.txt`, - content: faker.random.words(10) + name: `${faker.word.sample()}.txt`, + content: faker.word.words(10) } } diff --git a/cypress/e2e/gui/project/createProject.cy.js b/cypress/e2e/gui/project/createProject.cy.js index 2f6d7a2..e7f27b2 100644 --- a/cypress/e2e/gui/project/createProject.cy.js +++ b/cypress/e2e/gui/project/createProject.cy.js @@ -9,7 +9,7 @@ describe('Project', () => { it('creates a project', () => { const project = { name: `project-${faker.string.uuid()}`, - description: faker.random.words(5) + description: faker.word.words(5) } cy.gui_createProject(project) diff --git a/cypress/e2e/gui/project/createWiki.cy.js b/cypress/e2e/gui/project/createWiki.cy.js index bc023d7..3e13bdc 100644 --- a/cypress/e2e/gui/project/createWiki.cy.js +++ b/cypress/e2e/gui/project/createWiki.cy.js @@ -10,7 +10,7 @@ describe('Wiki', () => { }) it('creates a wiki', () => { - const wikiContent = faker.random.words(4) + const wikiContent = faker.word.words(4) cy.visit(`${Cypress.env('user_name')}/${project.name}/wikis/home?view=create`) diff --git a/cypress/e2e/gui/project/issueMilestone.cy.js b/cypress/e2e/gui/project/issueMilestone.cy.js index 9d30839..05e65f2 100644 --- a/cypress/e2e/gui/project/issueMilestone.cy.js +++ b/cypress/e2e/gui/project/issueMilestone.cy.js @@ -1,7 +1,7 @@ import { faker } from '@faker-js/faker/locale/en' describe('Issue milestone', () => { - const milestone = { title: `milestone-${faker.random.word()}` } + const milestone = { title: `milestone-${faker.word.sample()}` } beforeEach(() => { cy.api_deleteProjects() diff --git a/cypress/e2e/gui/project/labelAnIssue.cy.js b/cypress/e2e/gui/project/labelAnIssue.cy.js index 421bf77..366c57a 100644 --- a/cypress/e2e/gui/project/labelAnIssue.cy.js +++ b/cypress/e2e/gui/project/labelAnIssue.cy.js @@ -2,7 +2,7 @@ import { faker } from '@faker-js/faker/locale/en' describe('Issue label', () => { const label = { - name: `label-${faker.random.word()}`, + name: `label-${faker.word.sample()}`, color: '#ffaabb' } diff --git a/cypress/e2e/gui/project/starProject.cy.js b/cypress/e2e/gui/project/starProject.cy.js index f76c0e6..433b7c8 100644 --- a/cypress/e2e/gui/project/starProject.cy.js +++ b/cypress/e2e/gui/project/starProject.cy.js @@ -3,10 +3,10 @@ import { faker } from '@faker-js/faker/locale/en' describe('Star project', () => { const project = { name: `project-${faker.string.uuid()}`, - description: faker.random.words(5), + description: faker.word.words(5), issue: { title: `issue-${faker.string.uuid()}`, - description: faker.random.words(3) + description: faker.word.words(3) } } diff --git a/package-lock.json b/package-lock.json index 1efe8fa..fd1569f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@bahmutov/cypress-esbuild-preprocessor": "^2.2.3", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@esbuild-plugins/node-modules-polyfill": "^0.2.2", - "@faker-js/faker": "^8.4.1", + "@faker-js/faker": "^9.0.1", "cypress": "^13.14.2", "esbuild": "^0.23.1", "eslint": "^8.57.0", @@ -600,9 +600,9 @@ } }, "node_modules/@faker-js/faker": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.4.1.tgz", - "integrity": "sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-9.0.1.tgz", + "integrity": "sha512-4mDeYIgM3By7X6t5E6eYwLAa+2h4DeZDF7thhzIg6XB76jeEvMwadYAMCFJL/R4AnEBcAUO9+gL0vhy3s+qvZA==", "dev": true, "funding": [ { @@ -612,8 +612,8 @@ ], "license": "MIT", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0", - "npm": ">=6.14.13" + "node": ">=18.0.0", + "npm": ">=9.0.0" } }, "node_modules/@humanwhocodes/config-array": { @@ -5916,9 +5916,9 @@ "dev": true }, "@faker-js/faker": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.4.1.tgz", - "integrity": "sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-9.0.1.tgz", + "integrity": "sha512-4mDeYIgM3By7X6t5E6eYwLAa+2h4DeZDF7thhzIg6XB76jeEvMwadYAMCFJL/R4AnEBcAUO9+gL0vhy3s+qvZA==", "dev": true }, "@humanwhocodes/config-array": { diff --git a/package.json b/package.json index c12c542..8f0f6b6 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@bahmutov/cypress-esbuild-preprocessor": "^2.2.3", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@esbuild-plugins/node-modules-polyfill": "^0.2.2", - "@faker-js/faker": "^8.4.1", + "@faker-js/faker": "^9.0.1", "cypress": "^13.14.2", "esbuild": "^0.23.1", "eslint": "^8.57.0",