From 732128ba2bdf7b182f6889d1d985c58ec8c3ce11 Mon Sep 17 00:00:00 2001 From: VickyStash Date: Mon, 11 Mar 2024 15:09:36 +0100 Subject: [PATCH 1/9] [TS migration] Migrate 'reviewerChecklist.test.js' workflow test --- package-lock.json | 1460 +++-------------- package.json | 3 +- tsconfig.json | 2 +- workflow_tests/jest.config.js | 3 +- ...list.test.js => reviewerChecklist.test.ts} | 21 +- 5 files changed, 214 insertions(+), 1275 deletions(-) rename workflow_tests/{reviewerChecklist.test.js => reviewerChecklist.test.ts} (80%) diff --git a/package-lock.json b/package-lock.json index d009c9d3ad3c..209b2ee12676 100644 --- a/package-lock.json +++ b/package-lock.json @@ -236,6 +236,7 @@ "shellcheck": "^1.1.0", "style-loader": "^2.0.0", "time-analytics-webpack-plugin": "^0.1.17", + "ts-jest": "^29.1.2", "ts-node": "^10.9.2", "type-fest": "^4.10.2", "typescript": "^5.3.2", @@ -5962,30 +5963,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/console/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/console/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/@jest/console/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -6101,30 +6078,6 @@ } } }, - "node_modules/@jest/core/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/core/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/@jest/core/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -6206,94 +6159,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/create-cache-key-function/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/create-cache-key-function/node_modules/@types/yargs": { - "version": "17.0.31", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.31.tgz", - "integrity": "sha512-bocYSx4DI8TmdlvxqGpVNXOgCNR1Jj0gNPhhAY+iz1rgKDAaYrAYdFYnhDV1IFuiuVc9HkOwyDcFxaTElF3/wg==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@jest/create-cache-key-function/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/create-cache-key-function/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/create-cache-key-function/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/create-cache-key-function/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/@jest/create-cache-key-function/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/create-cache-key-function/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/environment": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", @@ -6308,94 +6173,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/environment/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/environment/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@jest/environment/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/environment/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/environment/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/environment/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/@jest/environment/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/environment/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/expect": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.6.2.tgz", @@ -6435,94 +6212,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/fake-timers/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/fake-timers/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@jest/fake-timers/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/fake-timers/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/fake-timers/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/fake-timers/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/@jest/fake-timers/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/fake-timers/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/globals": { "version": "29.5.0", "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.5.0.tgz", @@ -6537,94 +6226,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/globals/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/globals/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@jest/globals/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/globals/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/globals/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/globals/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/@jest/globals/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/globals/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/reporters": { "version": "29.4.1", "license": "MIT", @@ -6666,30 +6267,6 @@ } } }, - "node_modules/@jest/reporters/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/reporters/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/@jest/reporters/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -6825,100 +6402,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/test-result/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/test-result/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@jest/test-result/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/test-result/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/test-result/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/test-result/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT" - }, - "node_modules/@jest/test-result/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/test-result/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/test-sequencer": { "version": "29.4.1", "license": "MIT", @@ -6957,30 +6440,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/transform/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/transform/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/@jest/transform/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -7063,19 +6522,19 @@ } }, "node_modules/@jest/types": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", - "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", - "license": "MIT", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dependencies": { + "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", - "@types/yargs": "^15.0.0", + "@types/yargs": "^17.0.8", "chalk": "^4.0.0" }, "engines": { - "node": ">= 10.14.2" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/types/node_modules/ansi-styles": { @@ -9442,6 +8901,29 @@ "ws": "^7.5.1" } }, + "node_modules/@react-native-community/cli-server-api/node_modules/@jest/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/@react-native-community/cli-server-api/node_modules/@types/yargs": { + "version": "15.0.19", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.19.tgz", + "integrity": "sha512-2XUaGVmyQjgyAZldf0D0c14vvo/yv0MhQBSTJcejMMaitsn3nxCB6TmH4G0ZQf+uxROOa9mpanoSm8h6SG/1ZA==", + "dependencies": { + "@types/yargs-parser": "*" + } + }, "node_modules/@react-native-community/cli-server-api/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -9464,6 +8946,21 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/@react-native-community/cli-server-api/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/@react-native-community/cli-server-api/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -9480,6 +8977,14 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "node_modules/@react-native-community/cli-server-api/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, "node_modules/@react-native-community/cli-server-api/node_modules/pretty-format": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", @@ -9499,6 +9004,17 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, + "node_modules/@react-native-community/cli-server-api/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/@react-native-community/cli-server-api/node_modules/ws": { "version": "7.5.9", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", @@ -21229,18 +20745,17 @@ } }, "node_modules/@types/yargs": { - "version": "15.0.15", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.15.tgz", - "integrity": "sha512-IziEYMU9XoVj8hWg7k+UJrXALkGFjWJhn5QFEv9q4p+v40oZhSuC135M38st8XPjICL7Ey4TV64ferBGUoJhBg==", + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", + "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", "dependencies": { "@types/yargs-parser": "*" } }, "node_modules/@types/yargs-parser": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", - "license": "MIT" + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==" }, "node_modules/@types/yauzl": { "version": "2.10.0", @@ -25048,6 +24563,18 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/bser": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", @@ -35692,30 +35219,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-circus/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-circus/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/jest-circus/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -35820,30 +35323,6 @@ } } }, - "node_modules/jest-cli/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-cli/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/jest-cli/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -36006,30 +35485,6 @@ } } }, - "node_modules/jest-config/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-config/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/jest-config/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -36208,30 +35663,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-each/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-each/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/jest-each/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -36327,30 +35758,6 @@ } } }, - "node_modules/jest-environment-jsdom/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-environment-jsdom/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/jest-environment-jsdom/node_modules/acorn": { "version": "8.11.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", @@ -36362,55 +35769,6 @@ "node": ">=0.4.0" } }, - "node_modules/jest-environment-jsdom/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-environment-jsdom/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-environment-jsdom/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-environment-jsdom/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT" - }, "node_modules/jest-environment-jsdom/node_modules/cssstyle": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", @@ -36464,15 +35822,6 @@ "node": ">= 6" } }, - "node_modules/jest-environment-jsdom/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/jest-environment-jsdom/node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -36539,18 +35888,6 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/jest-environment-jsdom/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-environment-jsdom/node_modules/tr46": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", @@ -36628,94 +35965,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-environment-node/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-environment-node/node_modules/@types/yargs": { - "version": "17.0.31", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.31.tgz", - "integrity": "sha512-bocYSx4DI8TmdlvxqGpVNXOgCNR1Jj0gNPhhAY+iz1rgKDAaYrAYdFYnhDV1IFuiuVc9HkOwyDcFxaTElF3/wg==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/jest-environment-node/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-environment-node/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-environment-node/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-environment-node/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/jest-environment-node/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-environment-node/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-expo": { "version": "50.0.1", "resolved": "https://registry.npmjs.org/jest-expo/-/jest-expo-50.0.1.tgz", @@ -36788,75 +36037,6 @@ "fsevents": "^2.3.2" } }, - "node_modules/jest-haste-map/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-haste-map/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/jest-haste-map/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-haste-map/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-haste-map/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-haste-map/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, "node_modules/jest-haste-map/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -36893,17 +36073,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/jest-haste-map/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-leak-detector": { "version": "29.4.1", "license": "MIT", @@ -37018,30 +36187,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-message-util/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-message-util/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/jest-message-util/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -37119,94 +36264,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-mock/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-mock/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/jest-mock/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-mock/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-mock/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-mock/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/jest-mock/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-mock/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-pnp-resolver": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", @@ -37361,30 +36418,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-runner/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runner/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/jest-runner/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -37526,30 +36559,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-runtime/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runtime/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/jest-runtime/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -37650,30 +36659,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-snapshot/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/jest-snapshot/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -37764,30 +36749,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-util/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-util/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/jest-util/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -37868,30 +36829,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-validate/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-validate/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/jest-validate/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -38212,30 +37149,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-watcher/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-watcher/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/jest-watcher/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -38353,100 +37266,6 @@ "node": ">=8" } }, - "node_modules/jest/node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest/node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/jest/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT" - }, - "node_modules/jest/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/jest/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jimp-compact": { "version": "0.16.1", "resolved": "https://registry.npmjs.org/jimp-compact/-/jimp-compact-0.16.1.tgz", @@ -39228,6 +38047,12 @@ "dev": true, "peer": true }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -45174,6 +43999,29 @@ "node": ">=8" } }, + "node_modules/react-native/node_modules/@jest/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/react-native/node_modules/@types/yargs": { + "version": "15.0.19", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.19.tgz", + "integrity": "sha512-2XUaGVmyQjgyAZldf0D0c14vvo/yv0MhQBSTJcejMMaitsn3nxCB6TmH4G0ZQf+uxROOa9mpanoSm8h6SG/1ZA==", + "dependencies": { + "@types/yargs-parser": "*" + } + }, "node_modules/react-native/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -45196,6 +44044,21 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/react-native/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/react-native/node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -45238,6 +44101,14 @@ "node": ">=18" } }, + "node_modules/react-native/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, "node_modules/react-native/node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -45292,6 +44163,17 @@ "loose-envify": "^1.1.0" } }, + "node_modules/react-native/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/react-native/node_modules/ws": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz", @@ -50354,6 +49236,58 @@ "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" }, + "node_modules/ts-jest": { + "version": "29.1.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", + "integrity": "sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==", + "dev": true, + "dependencies": { + "bs-logger": "0.x", + "fast-json-stable-stringify": "2.x", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "4.x", + "make-error": "1.x", + "semver": "^7.5.3", + "yargs-parser": "^21.0.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^16.10.0 || ^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } + } + }, + "node_modules/ts-jest/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/ts-node": { "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", diff --git a/package.json b/package.json index 62da9d177dca..20779c73e402 100644 --- a/package.json +++ b/package.json @@ -157,8 +157,8 @@ "react-native-plaid-link-sdk": "10.8.0", "react-native-qrcode-svg": "^6.2.0", "react-native-quick-sqlite": "^8.0.0-beta.2", - "react-native-release-profiler": "^0.1.6", "react-native-reanimated": "^3.7.2", + "react-native-release-profiler": "^0.1.6", "react-native-render-html": "6.3.1", "react-native-safe-area-context": "4.8.2", "react-native-screens": "3.29.0", @@ -287,6 +287,7 @@ "shellcheck": "^1.1.0", "style-loader": "^2.0.0", "time-analytics-webpack-plugin": "^0.1.17", + "ts-jest": "^29.1.2", "ts-node": "^10.9.2", "type-fest": "^4.10.2", "typescript": "^5.3.2", diff --git a/tsconfig.json b/tsconfig.json index 30708f63d12b..79413fdd2ca7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -48,6 +48,6 @@ } }, "exclude": ["**/node_modules/*", "**/dist/*", ".github/actions/**/index.js", "**/docs/*"], - "include": ["src", "desktop", "web", "website", "docs", "assets", "config", "tests", "jest", "__mocks__", ".github/**/*", ".storybook/**/*"], + "include": ["src", "desktop", "web", "website", "docs", "assets", "config", "tests", "jest", "__mocks__", ".github/**/*", ".storybook/**/*", "workflow_tests"], "extends": "expo/tsconfig.base" } diff --git a/workflow_tests/jest.config.js b/workflow_tests/jest.config.js index c8a4534764e3..91857765b439 100644 --- a/workflow_tests/jest.config.js +++ b/workflow_tests/jest.config.js @@ -1,7 +1,8 @@ module.exports = { + preset: 'ts-jest', verbose: true, transform: { - '^.+\\.jsx?$': 'babel-jest', + '^.+\\.(js|jsx|ts|tsx)$': 'ts-jest', }, clearMocks: true, resetMocks: true, diff --git a/workflow_tests/reviewerChecklist.test.js b/workflow_tests/reviewerChecklist.test.ts similarity index 80% rename from workflow_tests/reviewerChecklist.test.js rename to workflow_tests/reviewerChecklist.test.ts index 9903c3eb4b8d..209e0974a8bf 100644 --- a/workflow_tests/reviewerChecklist.test.js +++ b/workflow_tests/reviewerChecklist.test.ts @@ -1,13 +1,14 @@ -const path = require('path'); -const kieMockGithub = require('@kie/mock-github'); -const utils = require('./utils/utils'); -const assertions = require('./assertions/reviewerChecklistAssertions'); -const mocks = require('./mocks/reviewerChecklistMocks'); -const eAct = require('./utils/ExtendedAct'); +import * as kieMockGithub from '@kie/mock-github'; +import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; +import path from 'path'; +import assertions from './assertions/reviewerChecklistAssertions'; +import mocks from './mocks/reviewerChecklistMocks'; +import eAct from './utils/ExtendedAct'; +import utils from './utils/utils'; jest.setTimeout(90 * 1000); -let mockGithub; -const FILES_TO_COPY_INTO_TEST_REPO = [ +let mockGithub: MockGithub; +const FILES_TO_COPY_INTO_TEST_REPO: CreateRepositoryFile[] = [ ...utils.deepCopy(utils.FILES_TO_COPY_INTO_TEST_REPO), { src: path.resolve(__dirname, '..', '.github', 'workflows', 'reviewerChecklist.yml'), @@ -42,11 +43,12 @@ describe('test workflow reviewerChecklist', () => { }); describe('event is pull_request_review', () => { const event = 'pull_request_review'; - const eventOptions = {}; + const eventOptions: Record = {}; it('runs the workflow', async () => { const repoPath = mockGithub.repo.getPath('testReviewerChecklistWorkflowRepo') || ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'reviewerChecklist.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); const testMockSteps = { checklist: mocks.REVIEWERCHECKLIST__CHECKLIST__STEP_MOCKS, @@ -66,6 +68,7 @@ describe('test workflow reviewerChecklist', () => { const repoPath = mockGithub.repo.getPath('testReviewerChecklistWorkflowRepo') || ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'reviewerChecklist.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); const testMockSteps = { checklist: mocks.REVIEWERCHECKLIST__CHECKLIST__STEP_MOCKS, From 58113e2e412573b23f1884619aea84cf4369780b Mon Sep 17 00:00:00 2001 From: VickyStash Date: Mon, 11 Mar 2024 15:25:58 +0100 Subject: [PATCH 2/9] [TS migration] Migrate 'test.test.js' workflow test --- workflow_tests/reviewerChecklist.test.ts | 7 ++-- workflow_tests/{test.test.js => test.test.ts} | 36 +++++++++++-------- 2 files changed, 26 insertions(+), 17 deletions(-) rename workflow_tests/{test.test.js => test.test.ts} (82%) diff --git a/workflow_tests/reviewerChecklist.test.ts b/workflow_tests/reviewerChecklist.test.ts index 209e0974a8bf..e786e5466ec8 100644 --- a/workflow_tests/reviewerChecklist.test.ts +++ b/workflow_tests/reviewerChecklist.test.ts @@ -1,3 +1,4 @@ +import type {MockStep} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; import * as kieMockGithub from '@kie/mock-github'; import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; import path from 'path'; @@ -43,14 +44,14 @@ describe('test workflow reviewerChecklist', () => { }); describe('event is pull_request_review', () => { const event = 'pull_request_review'; - const eventOptions: Record = {}; + const eventOptions = {}; it('runs the workflow', async () => { const repoPath = mockGithub.repo.getPath('testReviewerChecklistWorkflowRepo') || ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'reviewerChecklist.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); - const testMockSteps = { + const testMockSteps: MockStep = { checklist: mocks.REVIEWERCHECKLIST__CHECKLIST__STEP_MOCKS, }; const result = await act.runEvent(event, { @@ -70,7 +71,7 @@ describe('test workflow reviewerChecklist', () => { let act = new eAct.ExtendedAct(repoPath, workflowPath); // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); - const testMockSteps = { + const testMockSteps: MockStep = { checklist: mocks.REVIEWERCHECKLIST__CHECKLIST__STEP_MOCKS, }; const result = await act.runEvent(event, { diff --git a/workflow_tests/test.test.js b/workflow_tests/test.test.ts similarity index 82% rename from workflow_tests/test.test.js rename to workflow_tests/test.test.ts index 6efe8d260928..56b9179dafa2 100644 --- a/workflow_tests/test.test.js +++ b/workflow_tests/test.test.ts @@ -1,13 +1,15 @@ -const path = require('path'); -const kieMockGithub = require('@kie/mock-github'); -const utils = require('./utils/utils'); -const assertions = require('./assertions/testAssertions'); -const mocks = require('./mocks/testMocks'); -const eAct = require('./utils/ExtendedAct'); +import type {MockStep} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; +import * as kieMockGithub from '@kie/mock-github'; +import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; +import path from 'path'; +import assertions from './assertions/testAssertions'; +import mocks from './mocks/testMocks'; +import eAct from './utils/ExtendedAct'; +import utils from './utils/utils'; jest.setTimeout(90 * 1000); -let mockGithub; -const FILES_TO_COPY_INTO_TEST_REPO = [ +let mockGithub: MockGithub; +const FILES_TO_COPY_INTO_TEST_REPO: CreateRepositoryFile[] = [ ...utils.deepCopy(utils.FILES_TO_COPY_INTO_TEST_REPO), { src: path.resolve(__dirname, '..', '.github', 'workflows', 'test.yml'), @@ -52,8 +54,9 @@ describe('test workflow test', () => { const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') || ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); - const testMockSteps = { + const testMockSteps: MockStep = { jest: mocks.TEST__JEST__STEP_MOCKS, shellTests: mocks.TEST__SHELLTESTS__STEP_MOCKS, }; @@ -72,8 +75,9 @@ describe('test workflow test', () => { const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') || ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); - const testMockSteps = { + const testMockSteps: MockStep = { jest: mocks.TEST__JEST__STEP_MOCKS, shellTests: mocks.TEST__SHELLTESTS__STEP_MOCKS, }; @@ -99,8 +103,9 @@ describe('test workflow test', () => { const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') || ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); - const testMockSteps = { + const testMockSteps: MockStep = { jest: mocks.TEST__JEST__STEP_MOCKS, shellTests: mocks.TEST__SHELLTESTS__STEP_MOCKS, }; @@ -119,8 +124,9 @@ describe('test workflow test', () => { const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') || ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); - const testMockSteps = { + const testMockSteps: MockStep = { jest: mocks.TEST__JEST__STEP_MOCKS, shellTests: mocks.TEST__SHELLTESTS__STEP_MOCKS, }; @@ -144,8 +150,9 @@ describe('test workflow test', () => { const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') || ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); - const testMockSteps = { + const testMockSteps: MockStep = { jest: mocks.TEST__JEST__STEP_MOCKS, shellTests: mocks.TEST__SHELLTESTS__STEP_MOCKS, }; @@ -164,8 +171,9 @@ describe('test workflow test', () => { const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') || ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); - const testMockSteps = { + const testMockSteps: MockStep = { jest: mocks.TEST__JEST__STEP_MOCKS, shellTests: mocks.TEST__SHELLTESTS__STEP_MOCKS, }; From 825c3b79e8daa6039046b59d19a22d0a9921e5fc Mon Sep 17 00:00:00 2001 From: VickyStash Date: Mon, 11 Mar 2024 15:36:20 +0100 Subject: [PATCH 3/9] Fix lint problems --- workflow_tests/reviewerChecklist.test.ts | 6 +++--- workflow_tests/test.test.ts | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/workflow_tests/reviewerChecklist.test.ts b/workflow_tests/reviewerChecklist.test.ts index e786e5466ec8..e34e6a0e07fd 100644 --- a/workflow_tests/reviewerChecklist.test.ts +++ b/workflow_tests/reviewerChecklist.test.ts @@ -21,7 +21,7 @@ describe('test workflow reviewerChecklist', () => { const githubToken = 'dummy_github_token'; const actor = 'Dummy Actor'; - beforeAll(async () => { + beforeAll(() => { // in case of the tests being interrupted without cleanup the mock repo directory may be left behind // which breaks the next test run, this removes any possible leftovers utils.removeMockRepoDir(); @@ -46,7 +46,7 @@ describe('test workflow reviewerChecklist', () => { const event = 'pull_request_review'; const eventOptions = {}; it('runs the workflow', async () => { - const repoPath = mockGithub.repo.getPath('testReviewerChecklistWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testReviewerChecklistWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'reviewerChecklist.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. @@ -66,7 +66,7 @@ describe('test workflow reviewerChecklist', () => { describe('actor is OSBotify', () => { const osbotifyActor = 'OSBotify'; it('does not run the workflow', async () => { - const repoPath = mockGithub.repo.getPath('testReviewerChecklistWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testReviewerChecklistWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'reviewerChecklist.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. diff --git a/workflow_tests/test.test.ts b/workflow_tests/test.test.ts index 56b9179dafa2..8e6258c09b8b 100644 --- a/workflow_tests/test.test.ts +++ b/workflow_tests/test.test.ts @@ -22,7 +22,7 @@ describe('test workflow test', () => { const actor = 'Dummy Actor'; const osbotifyActor = 'OSBotify'; - beforeAll(async () => { + beforeAll(() => { // in case of the tests being interrupted without cleanup the mock repo directory may be left behind // which breaks the next test run, this removes any possible leftovers utils.removeMockRepoDir(); @@ -51,7 +51,7 @@ describe('test workflow test', () => { action: 'opened', }; it('runs all tests', async () => { - const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. @@ -72,7 +72,7 @@ describe('test workflow test', () => { }); describe('actor is OSBotify', () => { it('does not run tests', async () => { - const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. @@ -100,7 +100,7 @@ describe('test workflow test', () => { action: 'synchronize', }; it('runs all tests', async () => { - const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. @@ -121,7 +121,7 @@ describe('test workflow test', () => { }); describe('actor is OSBotify', () => { it('does not run tests', async () => { - const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. @@ -147,7 +147,7 @@ describe('test workflow test', () => { const event = 'workflow_call'; const eventOptions = {}; it('runs all tests', async () => { - const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. @@ -168,7 +168,7 @@ describe('test workflow test', () => { }); describe('actor is OSBotify', () => { it('runs all tests normally', async () => { - const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. From 50d4ce0ccb5e1e3491c70017d8f51747df216dfb Mon Sep 17 00:00:00 2001 From: VickyStash Date: Mon, 11 Mar 2024 18:19:17 +0100 Subject: [PATCH 4/9] [TS migration] Migrate 'lockDeploys.test.js' workflow test --- ...ockDeploys.test.js => lockDeploys.test.ts} | 66 +++++++++++-------- 1 file changed, 39 insertions(+), 27 deletions(-) rename workflow_tests/{lockDeploys.test.js => lockDeploys.test.ts} (88%) diff --git a/workflow_tests/lockDeploys.test.js b/workflow_tests/lockDeploys.test.ts similarity index 88% rename from workflow_tests/lockDeploys.test.js rename to workflow_tests/lockDeploys.test.ts index a57ed8847fd3..b72db2c3bb85 100644 --- a/workflow_tests/lockDeploys.test.js +++ b/workflow_tests/lockDeploys.test.ts @@ -1,13 +1,15 @@ -const path = require('path'); -const kieMockGithub = require('@kie/mock-github'); -const utils = require('./utils/utils'); -const assertions = require('./assertions/lockDeploysAssertions'); -const mocks = require('./mocks/lockDeploysMocks'); -const eAct = require('./utils/ExtendedAct'); +import type {MockStep} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; +import * as kieMockGithub from '@kie/mock-github'; +import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; +import path from 'path'; +import assertions from './assertions/lockDeploysAssertions'; +import mocks from './mocks/lockDeploysMocks'; +import eAct from './utils/ExtendedAct'; +import utils from './utils/utils'; jest.setTimeout(90 * 1000); -let mockGithub; -const FILES_TO_COPY_INTO_TEST_REPO = [ +let mockGithub: MockGithub; +const FILES_TO_COPY_INTO_TEST_REPO: CreateRepositoryFile[] = [ ...utils.deepCopy(utils.FILES_TO_COPY_INTO_TEST_REPO), { src: path.resolve(__dirname, '..', '.github', 'workflows', 'lockDeploys.yml'), @@ -16,7 +18,7 @@ const FILES_TO_COPY_INTO_TEST_REPO = [ ]; describe('test workflow lockDeploys', () => { - beforeAll(async () => { + beforeAll(() => { // in case of the tests being interrupted without cleanup the mock repo directory may be left behind // which breaks the next test run, this removes any possible leftovers utils.removeMockRepoDir(); @@ -43,11 +45,12 @@ describe('test workflow lockDeploys', () => { describe('issue has StagingDeployCash', () => { describe('actor is not OSBotify', () => { it('job triggered, comment left in StagingDeployCash', async () => { - const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'lockDeploys.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -71,7 +74,7 @@ describe('test workflow lockDeploys', () => { }, workflowPath, ); - const testMockSteps = { + const testMockSteps: MockStep = { lockStagingDeploys: mocks.LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS, }; const result = await act.runEvent('issues', { @@ -85,11 +88,12 @@ describe('test workflow lockDeploys', () => { }); it('one step fails, comment not left in StagingDeployCash, announced failure in Slack', async () => { - const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'lockDeploys.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -113,12 +117,13 @@ describe('test workflow lockDeploys', () => { }, workflowPath, ); - const testMockSteps = { + const testMockSteps: MockStep = { lockStagingDeploys: mocks.LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS, }; testMockSteps.lockStagingDeploys[1] = utils.createMockStep( 'Wait for staging deploys to finish', 'Waiting for staging deploys to finish', + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'LOCKSTAGINGDEPLOYS', ['GITHUB_TOKEN'], [], @@ -139,11 +144,12 @@ describe('test workflow lockDeploys', () => { describe('actor is OSBotify', () => { it('job not triggered, comment not left in StagingDeployCash', async () => { - const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'lockDeploys.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -167,7 +173,7 @@ describe('test workflow lockDeploys', () => { }, workflowPath, ); - const testMockSteps = { + const testMockSteps: MockStep = { lockStagingDeploys: mocks.LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS, }; const result = await act.runEvent('issues', { @@ -185,11 +191,12 @@ describe('test workflow lockDeploys', () => { describe('issue does not have StagingDeployCash', () => { describe('actor is not OSBotify', () => { it('job not triggered, comment not left in StagingDeployCash', async () => { - const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'lockDeploys.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -213,7 +220,7 @@ describe('test workflow lockDeploys', () => { }, workflowPath, ); - const testMockSteps = { + const testMockSteps: MockStep = { lockStagingDeploys: mocks.LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS, }; const result = await act.runEvent('issues', { @@ -229,11 +236,12 @@ describe('test workflow lockDeploys', () => { describe('actor is OSBotify', () => { it('job not triggered, comment not left in StagingDeployCash', async () => { - const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'lockDeploys.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -257,7 +265,7 @@ describe('test workflow lockDeploys', () => { }, workflowPath, ); - const testMockSteps = { + const testMockSteps: MockStep = { lockStagingDeploys: mocks.LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS, }; const result = await act.runEvent('issues', { @@ -277,11 +285,12 @@ describe('test workflow lockDeploys', () => { describe('issue has StagingDeployCash', () => { describe('actor is not OSBotify', () => { it('job not triggered, comment not left in StagingDeployCash', async () => { - const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'lockDeploys.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -305,7 +314,7 @@ describe('test workflow lockDeploys', () => { }, workflowPath, ); - const testMockSteps = { + const testMockSteps: MockStep = { lockStagingDeploys: mocks.LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS, }; const result = await act.runEvent('issues', { @@ -321,11 +330,12 @@ describe('test workflow lockDeploys', () => { describe('actor is OSBotify', () => { it('job not triggered, comment not left in StagingDeployCash', async () => { - const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'lockDeploys.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -349,7 +359,7 @@ describe('test workflow lockDeploys', () => { }, workflowPath, ); - const testMockSteps = { + const testMockSteps: MockStep = { lockStagingDeploys: mocks.LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS, }; const result = await act.runEvent('issues', { @@ -367,11 +377,12 @@ describe('test workflow lockDeploys', () => { describe('issue does not have StagingDeployCash', () => { describe('actor is not OSBotify', () => { it('job not triggered, comment not left in StagingDeployCash', async () => { - const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'lockDeploys.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -395,7 +406,7 @@ describe('test workflow lockDeploys', () => { }, workflowPath, ); - const testMockSteps = { + const testMockSteps: MockStep = { lockStagingDeploys: mocks.LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS, }; const result = await act.runEvent('issues', { @@ -411,11 +422,12 @@ describe('test workflow lockDeploys', () => { describe('actor is OSBotify', () => { it('job not triggered, comment not left in StagingDeployCash', async () => { - const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testLockDeploysWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'lockDeploys.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -439,7 +451,7 @@ describe('test workflow lockDeploys', () => { }, workflowPath, ); - const testMockSteps = { + const testMockSteps: MockStep = { lockStagingDeploys: mocks.LOCKDEPLOYS__LOCKSTAGINGDEPLOYS__STEP_MOCKS, }; const result = await act.runEvent('issues', { From 902f9249bb67e68d087814b741cb5f5e15641cad Mon Sep 17 00:00:00 2001 From: VickyStash Date: Tue, 12 Mar 2024 12:48:21 +0100 Subject: [PATCH 5/9] [TS migration] Migrate 'preDeploy.test.js', 'platformDeploy.test.js' workflow test --- ...mDeploy.test.js => platformDeploy.test.ts} | 37 +++++--- .../{preDeploy.test.js => preDeploy.test.ts} | 88 ++++++++++++------- 2 files changed, 81 insertions(+), 44 deletions(-) rename workflow_tests/{platformDeploy.test.js => platformDeploy.test.ts} (89%) rename workflow_tests/{preDeploy.test.js => preDeploy.test.ts} (88%) diff --git a/workflow_tests/platformDeploy.test.js b/workflow_tests/platformDeploy.test.ts similarity index 89% rename from workflow_tests/platformDeploy.test.js rename to workflow_tests/platformDeploy.test.ts index 6bcd5ff5b896..c9d4b0ff604b 100644 --- a/workflow_tests/platformDeploy.test.js +++ b/workflow_tests/platformDeploy.test.ts @@ -1,13 +1,15 @@ -const path = require('path'); -const kieMockGithub = require('@kie/mock-github'); -const utils = require('./utils/utils'); -const assertions = require('./assertions/platformDeployAssertions'); -const mocks = require('./mocks/platformDeployMocks'); -const eAct = require('./utils/ExtendedAct'); +import type {MockStep} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; +import * as kieMockGithub from '@kie/mock-github'; +import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; +import path from 'path'; +import assertions from './assertions/platformDeployAssertions'; +import mocks from './mocks/platformDeployMocks'; +import eAct from './utils/ExtendedAct'; +import utils from './utils/utils'; jest.setTimeout(90 * 1000); -let mockGithub; -const FILES_TO_COPY_INTO_TEST_REPO = [ +let mockGithub: MockGithub; +const FILES_TO_COPY_INTO_TEST_REPO: CreateRepositoryFile[] = [ ...utils.deepCopy(utils.FILES_TO_COPY_INTO_TEST_REPO), { src: path.resolve(__dirname, '..', '.github', 'workflows', 'platformDeploy.yml'), @@ -16,7 +18,7 @@ const FILES_TO_COPY_INTO_TEST_REPO = [ ]; describe('test workflow platformDeploy', () => { - beforeAll(async () => { + beforeAll(() => { // in case of the tests being interrupted without cleanup the mock repo directory may be left behind // which breaks the next test run, this removes any possible leftovers utils.removeMockRepoDir(); @@ -42,15 +44,18 @@ describe('test workflow platformDeploy', () => { describe('push', () => { describe('tag', () => { it('as team member - platform deploy executes on staging', async () => { - const repoPath = mockGithub.repo.getPath('testPlatformDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPlatformDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'platformDeploy.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', { ref: 'refs/tags/1.2.3', + // eslint-disable-next-line @typescript-eslint/naming-convention ref_type: 'tag', + // eslint-disable-next-line @typescript-eslint/naming-convention ref_name: '1.2.3', }, { @@ -88,7 +93,7 @@ describe('test workflow platformDeploy', () => { }, workflowPath, ); - const testMockSteps = { + const testMockSteps: MockStep = { validateActor: mocks.PLATFORM_DEPLOY__VALIDATE_ACTOR__TEAM_MEMBER__STEP_MOCKS, android: mocks.PLATFORM_DEPLOY__ANDROID__STEP_MOCKS, desktop: mocks.PLATFORM_DEPLOY__DESKTOP__STEP_MOCKS, @@ -124,15 +129,18 @@ describe('test workflow platformDeploy', () => { }); it('as OSBotify - platform deploy executes on staging', async () => { - const repoPath = mockGithub.repo.getPath('testPlatformDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPlatformDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'platformDeploy.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', { ref: 'refs/tags/1.2.3', + // eslint-disable-next-line @typescript-eslint/naming-convention ref_type: 'tag', + // eslint-disable-next-line @typescript-eslint/naming-convention ref_name: '1.2.3', }, { @@ -206,15 +214,18 @@ describe('test workflow platformDeploy', () => { }); it('as outsider - platform deploy does not execute', async () => { - const repoPath = mockGithub.repo.getPath('testPlatformDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPlatformDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'platformDeploy.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', { ref: 'refs/tags/1.2.3', + // eslint-disable-next-line @typescript-eslint/naming-convention ref_type: 'tag', + // eslint-disable-next-line @typescript-eslint/naming-convention ref_name: '1.2.3', }, { diff --git a/workflow_tests/preDeploy.test.js b/workflow_tests/preDeploy.test.ts similarity index 88% rename from workflow_tests/preDeploy.test.js rename to workflow_tests/preDeploy.test.ts index 0d5b126b4430..8934e6a36fb9 100644 --- a/workflow_tests/preDeploy.test.js +++ b/workflow_tests/preDeploy.test.ts @@ -1,13 +1,15 @@ -const path = require('path'); -const kieMockGithub = require('@kie/mock-github'); -const utils = require('./utils/utils'); -const assertions = require('./assertions/preDeployAssertions'); -const mocks = require('./mocks/preDeployMocks'); -const eAct = require('./utils/ExtendedAct'); +import type {MockStep} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; +import * as kieMockGithub from '@kie/mock-github'; +import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; +import path from 'path'; +import assertions from './assertions/preDeployAssertions'; +import mocks from './mocks/preDeployMocks'; +import eAct from './utils/ExtendedAct'; +import utils from './utils/utils'; jest.setTimeout(90 * 1000); -let mockGithub; -const FILES_TO_COPY_INTO_TEST_REPO = [ +let mockGithub: MockGithub; +const FILES_TO_COPY_INTO_TEST_REPO: CreateRepositoryFile[] = [ ...utils.deepCopy(utils.FILES_TO_COPY_INTO_TEST_REPO), { src: path.resolve(__dirname, '..', '.github', 'workflows', 'preDeploy.yml'), @@ -16,7 +18,7 @@ const FILES_TO_COPY_INTO_TEST_REPO = [ ]; describe('test workflow preDeploy', () => { - beforeAll(async () => { + beforeAll(() => { // in case of the tests being interrupted without cleanup the mock repo directory may be left behind // which breaks the next test run, this removes any possible leftovers utils.removeMockRepoDir(); @@ -41,7 +43,7 @@ describe('test workflow preDeploy', () => { }); it('push to main - workflow executes', async () => { // get path to the local test repo - const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') ?? ''; // get path to the workflow file under test const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml'); @@ -52,6 +54,7 @@ describe('test workflow preDeploy', () => { // set run parameters act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -63,7 +66,7 @@ describe('test workflow preDeploy', () => { ); // set up mocks - const testMockSteps = { + const testMockSteps: MockStep = { confirmPassingBuild: mocks.CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS, chooseDeployActions: mocks.CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_UNLOCKED, skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, @@ -117,10 +120,10 @@ describe('test workflow preDeploy', () => { }); it('different event than push - workflow does not execute', async () => { - const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); - const testMockSteps = { + const testMockSteps: MockStep = { confirmPassingBuild: mocks.CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS, chooseDeployActions: mocks.CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_UNLOCKED, skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, @@ -156,6 +159,7 @@ describe('test workflow preDeploy', () => { // pull_request act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'pull_request', {head: {ref: 'main'}}, { @@ -183,6 +187,7 @@ describe('test workflow preDeploy', () => { // workflow_dispatch act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'workflow_dispatch', {}, { @@ -210,11 +215,12 @@ describe('test workflow preDeploy', () => { describe('confirm passing build', () => { it('typecheck job failed - workflow exits', async () => { - const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -224,7 +230,7 @@ describe('test workflow preDeploy', () => { }, 'dummy_github_token', ); - const testMockSteps = { + const testMockSteps: MockStep = { confirmPassingBuild: mocks.CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS, chooseDeployActions: mocks.CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_UNLOCKED, skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, @@ -232,6 +238,7 @@ describe('test workflow preDeploy', () => { }; const testMockJobs = { typecheck: { + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. steps: [utils.createMockStep('Run typecheck workflow', 'Running typecheck workflow - Typecheck workflow failed', 'TYPECHECK', null, null, null, null, false)], runsOn: 'ubuntu-latest', }, @@ -264,15 +271,18 @@ describe('test workflow preDeploy', () => { mockJobs: testMockJobs, }); expect(result).toEqual( + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. expect.arrayContaining([utils.createStepAssertion('Run typecheck workflow', false, null, 'TYPECHECK', 'Running typecheck workflow - Typecheck workflow failed')]), ); assertions.assertLintJobExecuted(result); assertions.assertTestJobExecuted(result); expect(result).toEqual( expect.arrayContaining([ + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. utils.createStepAssertion('Announce failed workflow in Slack', true, null, 'CONFIRM_PASSING_BUILD', 'Announcing failed workflow in slack', [ {key: 'SLACK_WEBHOOK', value: '***'}, ]), + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. utils.createStepAssertion('Exit failed workflow', false, ''), ]), ); @@ -283,11 +293,12 @@ describe('test workflow preDeploy', () => { }); it('lint job failed - workflow exits', async () => { - const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -297,7 +308,7 @@ describe('test workflow preDeploy', () => { }, 'dummy_github_token', ); - const testMockSteps = { + const testMockSteps: MockStep = { confirmPassingBuild: mocks.CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS, chooseDeployActions: mocks.CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_UNLOCKED, skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, @@ -309,6 +320,7 @@ describe('test workflow preDeploy', () => { runsOn: 'ubuntu-latest', }, lint: { + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. steps: [utils.createMockStep('Run lint workflow', 'Running lint workflow - Lint workflow failed', 'LINT', null, null, null, null, false)], runsOn: 'ubuntu-latest', }, @@ -337,13 +349,16 @@ describe('test workflow preDeploy', () => { mockJobs: testMockJobs, }); assertions.assertTypecheckJobExecuted(result); + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. expect(result).toEqual(expect.arrayContaining([utils.createStepAssertion('Run lint workflow', false, null, 'LINT', 'Running lint workflow - Lint workflow failed')])); assertions.assertTestJobExecuted(result); expect(result).toEqual( expect.arrayContaining([ + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. utils.createStepAssertion('Announce failed workflow in Slack', true, null, 'CONFIRM_PASSING_BUILD', 'Announcing failed workflow in slack', [ {key: 'SLACK_WEBHOOK', value: '***'}, ]), + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. utils.createStepAssertion('Exit failed workflow', false, ''), ]), ); @@ -354,11 +369,12 @@ describe('test workflow preDeploy', () => { }); it('test job failed - workflow exits', async () => { - const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -368,7 +384,7 @@ describe('test workflow preDeploy', () => { }, 'dummy_github_token', ); - const testMockSteps = { + const testMockSteps: MockStep = { confirmPassingBuild: mocks.CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS, chooseDeployActions: mocks.CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_UNLOCKED, skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, @@ -384,6 +400,7 @@ describe('test workflow preDeploy', () => { runsOn: 'ubuntu-latest', }, test: { + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. steps: [utils.createMockStep('Run test workflow', 'Running test workflow - Test workflow failed', 'TEST', null, null, null, null, false)], runsOn: 'ubuntu-latest', }, @@ -409,12 +426,15 @@ describe('test workflow preDeploy', () => { }); assertions.assertTypecheckJobExecuted(result); assertions.assertLintJobExecuted(result); + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. expect(result).toEqual(expect.arrayContaining([utils.createStepAssertion('Run test workflow', false, null, 'TEST', 'Running test workflow - Test workflow failed')])); expect(result).toEqual( expect.arrayContaining([ + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. utils.createStepAssertion('Announce failed workflow in Slack', true, null, 'CONFIRM_PASSING_BUILD', 'Announcing failed workflow in slack', [ {key: 'SLACK_WEBHOOK', value: '***'}, ]), + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. utils.createStepAssertion('Exit failed workflow', false, ''), ]), ); @@ -425,11 +445,12 @@ describe('test workflow preDeploy', () => { }); it('lint and test job succeed - workflow continues', async () => { - const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -439,7 +460,7 @@ describe('test workflow preDeploy', () => { }, 'dummy_github_token', ); - const testMockSteps = { + const testMockSteps: MockStep = { confirmPassingBuild: mocks.CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS, chooseDeployActions: mocks.CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_UNLOCKED, skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, @@ -491,11 +512,12 @@ describe('test workflow preDeploy', () => { describe('choose deploy actions', () => { describe('staging locked', () => { it('not automated PR - deploy skipped and comment left', async () => { - const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, 'push', {ref: 'refs/heads/main'}, {OS_BOTIFY_TOKEN: 'dummy_token', SLACK_WEBHOOK: 'dummy_slack_webhook'}, 'dummy_github_token'); - const testMockSteps = { + const testMockSteps: MockStep = { confirmPassingBuild: mocks.CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS, chooseDeployActions: mocks.CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_LOCKED, skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, @@ -545,11 +567,12 @@ describe('test workflow preDeploy', () => { }); it('automated PR - deploy skipped, but no comment left', async () => { - const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, 'push', {ref: 'refs/heads/main'}, {OS_BOTIFY_TOKEN: 'dummy_token', SLACK_WEBHOOK: 'dummy_slack_webhook'}, 'dummy_github_token'); - const testMockSteps = { + const testMockSteps: MockStep = { confirmPassingBuild: mocks.CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS, chooseDeployActions: mocks.CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_LOCKED, skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, @@ -601,11 +624,12 @@ describe('test workflow preDeploy', () => { describe('staging not locked', () => { it('not automated PR - proceed with deploy', async () => { - const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -615,7 +639,7 @@ describe('test workflow preDeploy', () => { }, 'dummy_github_token', ); - const testMockSteps = { + const testMockSteps: MockStep = { confirmPassingBuild: mocks.CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS, chooseDeployActions: mocks.CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_UNLOCKED, skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, @@ -665,11 +689,12 @@ describe('test workflow preDeploy', () => { }); it('automated PR - deploy skipped, but no comment left', async () => { - const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -678,7 +703,7 @@ describe('test workflow preDeploy', () => { }, 'dummy_github_token', ); - const testMockSteps = { + const testMockSteps: MockStep = { confirmPassingBuild: mocks.CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS, chooseDeployActions: mocks.CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_UNLOCKED, skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, @@ -729,11 +754,12 @@ describe('test workflow preDeploy', () => { }); it('one of updateStaging steps failed - failure announced in Slack', async () => { - const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || ''; + const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml'); let act = new eAct.ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, + // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -743,7 +769,7 @@ describe('test workflow preDeploy', () => { }, 'dummy_github_token', ); - const testMockSteps = { + const testMockSteps: MockStep = { confirmPassingBuild: mocks.CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS, chooseDeployActions: mocks.CHOOSE_DEPLOY_ACTIONS_JOB_MOCK_STEPS__STAGING_UNLOCKED, skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, From a7239836bee6777b3479d311876ebe4f620b16d9 Mon Sep 17 00:00:00 2001 From: VickyStash Date: Wed, 20 Mar 2024 15:07:28 +0100 Subject: [PATCH 6/9] Remove unnecessary TODOs --- workflow_tests/lockDeploys.test.ts | 12 +---------- workflow_tests/platformDeploy.test.ts | 5 +---- workflow_tests/preDeploy.test.ts | 26 +----------------------- workflow_tests/reviewerChecklist.test.ts | 4 +--- workflow_tests/test.test.ts | 8 +------- workflow_tests/utils/utils.ts | 14 +++++++++++++ 6 files changed, 19 insertions(+), 50 deletions(-) diff --git a/workflow_tests/lockDeploys.test.ts b/workflow_tests/lockDeploys.test.ts index bb33c165b693..fe63d39d81cf 100644 --- a/workflow_tests/lockDeploys.test.ts +++ b/workflow_tests/lockDeploys.test.ts @@ -5,7 +5,7 @@ import path from 'path'; import assertions from './assertions/lockDeploysAssertions'; import mocks from './mocks/lockDeploysMocks'; import ExtendedAct from './utils/ExtendedAct'; -import utils from './utils/utils'; +import * as utils from './utils/utils'; jest.setTimeout(90 * 1000); let mockGithub: MockGithub; @@ -50,7 +50,6 @@ describe('test workflow lockDeploys', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -93,7 +92,6 @@ describe('test workflow lockDeploys', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -123,7 +121,6 @@ describe('test workflow lockDeploys', () => { testMockSteps.lockStagingDeploys[1] = utils.createMockStep( 'Wait for staging deploys to finish', 'Waiting for staging deploys to finish', - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'LOCKSTAGINGDEPLOYS', ['GITHUB_TOKEN'], [], @@ -149,7 +146,6 @@ describe('test workflow lockDeploys', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -196,7 +192,6 @@ describe('test workflow lockDeploys', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -241,7 +236,6 @@ describe('test workflow lockDeploys', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -290,7 +284,6 @@ describe('test workflow lockDeploys', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -335,7 +328,6 @@ describe('test workflow lockDeploys', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -382,7 +374,6 @@ describe('test workflow lockDeploys', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', @@ -427,7 +418,6 @@ describe('test workflow lockDeploys', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'issues', { action: 'labeled', diff --git a/workflow_tests/platformDeploy.test.ts b/workflow_tests/platformDeploy.test.ts index b091827ef662..3866f07cefdc 100644 --- a/workflow_tests/platformDeploy.test.ts +++ b/workflow_tests/platformDeploy.test.ts @@ -5,7 +5,7 @@ import path from 'path'; import assertions from './assertions/platformDeployAssertions'; import mocks from './mocks/platformDeployMocks'; import ExtendedAct from './utils/ExtendedAct'; -import utils from './utils/utils'; +import * as utils from './utils/utils'; jest.setTimeout(90 * 1000); let mockGithub: MockGithub; @@ -49,7 +49,6 @@ describe('test workflow platformDeploy', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', { ref: 'refs/tags/1.2.3', @@ -134,7 +133,6 @@ describe('test workflow platformDeploy', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', { ref: 'refs/tags/1.2.3', @@ -219,7 +217,6 @@ describe('test workflow platformDeploy', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', { ref: 'refs/tags/1.2.3', diff --git a/workflow_tests/preDeploy.test.ts b/workflow_tests/preDeploy.test.ts index d3a532931ee2..2ddf761089f8 100644 --- a/workflow_tests/preDeploy.test.ts +++ b/workflow_tests/preDeploy.test.ts @@ -5,7 +5,7 @@ import path from 'path'; import assertions from './assertions/preDeployAssertions'; import mocks from './mocks/preDeployMocks'; import ExtendedAct from './utils/ExtendedAct'; -import utils from './utils/utils'; +import * as utils from './utils/utils'; jest.setTimeout(90 * 1000); let mockGithub: MockGithub; @@ -54,7 +54,6 @@ describe('test workflow preDeploy', () => { // set run parameters act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -159,7 +158,6 @@ describe('test workflow preDeploy', () => { // pull_request act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'pull_request', {head: {ref: 'main'}}, { @@ -187,7 +185,6 @@ describe('test workflow preDeploy', () => { // workflow_dispatch act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'workflow_dispatch', {}, { @@ -220,7 +217,6 @@ describe('test workflow preDeploy', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -238,7 +234,6 @@ describe('test workflow preDeploy', () => { }; const testMockJobs = { typecheck: { - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. steps: [utils.createMockStep('Run typecheck workflow', 'Running typecheck workflow - Typecheck workflow failed', 'TYPECHECK', null, null, null, null, false)], runsOn: 'ubuntu-latest', }, @@ -271,18 +266,15 @@ describe('test workflow preDeploy', () => { mockJobs: testMockJobs, }); expect(result).toEqual( - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. expect.arrayContaining([utils.createStepAssertion('Run typecheck workflow', false, null, 'TYPECHECK', 'Running typecheck workflow - Typecheck workflow failed')]), ); assertions.assertLintJobExecuted(result); assertions.assertTestJobExecuted(result); expect(result).toEqual( expect.arrayContaining([ - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. utils.createStepAssertion('Announce failed workflow in Slack', true, null, 'CONFIRM_PASSING_BUILD', 'Announcing failed workflow in slack', [ {key: 'SLACK_WEBHOOK', value: '***'}, ]), - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. utils.createStepAssertion('Exit failed workflow', false, ''), ]), ); @@ -298,7 +290,6 @@ describe('test workflow preDeploy', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -320,7 +311,6 @@ describe('test workflow preDeploy', () => { runsOn: 'ubuntu-latest', }, lint: { - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. steps: [utils.createMockStep('Run lint workflow', 'Running lint workflow - Lint workflow failed', 'LINT', null, null, null, null, false)], runsOn: 'ubuntu-latest', }, @@ -349,16 +339,13 @@ describe('test workflow preDeploy', () => { mockJobs: testMockJobs, }); assertions.assertTypecheckJobExecuted(result); - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. expect(result).toEqual(expect.arrayContaining([utils.createStepAssertion('Run lint workflow', false, null, 'LINT', 'Running lint workflow - Lint workflow failed')])); assertions.assertTestJobExecuted(result); expect(result).toEqual( expect.arrayContaining([ - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. utils.createStepAssertion('Announce failed workflow in Slack', true, null, 'CONFIRM_PASSING_BUILD', 'Announcing failed workflow in slack', [ {key: 'SLACK_WEBHOOK', value: '***'}, ]), - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. utils.createStepAssertion('Exit failed workflow', false, ''), ]), ); @@ -374,7 +361,6 @@ describe('test workflow preDeploy', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -400,7 +386,6 @@ describe('test workflow preDeploy', () => { runsOn: 'ubuntu-latest', }, test: { - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. steps: [utils.createMockStep('Run test workflow', 'Running test workflow - Test workflow failed', 'TEST', null, null, null, null, false)], runsOn: 'ubuntu-latest', }, @@ -426,15 +411,12 @@ describe('test workflow preDeploy', () => { }); assertions.assertTypecheckJobExecuted(result); assertions.assertLintJobExecuted(result); - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. expect(result).toEqual(expect.arrayContaining([utils.createStepAssertion('Run test workflow', false, null, 'TEST', 'Running test workflow - Test workflow failed')])); expect(result).toEqual( expect.arrayContaining([ - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. utils.createStepAssertion('Announce failed workflow in Slack', true, null, 'CONFIRM_PASSING_BUILD', 'Announcing failed workflow in slack', [ {key: 'SLACK_WEBHOOK', value: '***'}, ]), - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. utils.createStepAssertion('Exit failed workflow', false, ''), ]), ); @@ -450,7 +432,6 @@ describe('test workflow preDeploy', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -515,7 +496,6 @@ describe('test workflow preDeploy', () => { const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml'); let act = new ExtendedAct(repoPath, workflowPath); - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, 'push', {ref: 'refs/heads/main'}, {OS_BOTIFY_TOKEN: 'dummy_token', SLACK_WEBHOOK: 'dummy_slack_webhook'}, 'dummy_github_token'); const testMockSteps: MockStep = { confirmPassingBuild: mocks.CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS, @@ -570,7 +550,6 @@ describe('test workflow preDeploy', () => { const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml'); let act = new ExtendedAct(repoPath, workflowPath); - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, 'push', {ref: 'refs/heads/main'}, {OS_BOTIFY_TOKEN: 'dummy_token', SLACK_WEBHOOK: 'dummy_slack_webhook'}, 'dummy_github_token'); const testMockSteps: MockStep = { confirmPassingBuild: mocks.CONFIRM_PASSING_BUILD_JOB_MOCK_STEPS, @@ -629,7 +608,6 @@ describe('test workflow preDeploy', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -694,7 +672,6 @@ describe('test workflow preDeploy', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { @@ -759,7 +736,6 @@ describe('test workflow preDeploy', () => { let act = new ExtendedAct(repoPath, workflowPath); act = utils.setUpActParams( act, - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. 'push', {ref: 'refs/heads/main'}, { diff --git a/workflow_tests/reviewerChecklist.test.ts b/workflow_tests/reviewerChecklist.test.ts index 0f3a67f8c450..04ab47cd955b 100644 --- a/workflow_tests/reviewerChecklist.test.ts +++ b/workflow_tests/reviewerChecklist.test.ts @@ -5,7 +5,7 @@ import path from 'path'; import assertions from './assertions/reviewerChecklistAssertions'; import mocks from './mocks/reviewerChecklistMocks'; import ExtendedAct from './utils/ExtendedAct'; -import utils from './utils/utils'; +import * as utils from './utils/utils'; jest.setTimeout(90 * 1000); let mockGithub: MockGithub; @@ -49,7 +49,6 @@ describe('test workflow reviewerChecklist', () => { const repoPath = mockGithub.repo.getPath('testReviewerChecklistWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'reviewerChecklist.yml'); let act = new ExtendedAct(repoPath, workflowPath); - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); const testMockSteps: MockStep = { checklist: mocks.REVIEWERCHECKLIST__CHECKLIST__STEP_MOCKS, @@ -69,7 +68,6 @@ describe('test workflow reviewerChecklist', () => { const repoPath = mockGithub.repo.getPath('testReviewerChecklistWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'reviewerChecklist.yml'); let act = new ExtendedAct(repoPath, workflowPath); - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); const testMockSteps: MockStep = { checklist: mocks.REVIEWERCHECKLIST__CHECKLIST__STEP_MOCKS, diff --git a/workflow_tests/test.test.ts b/workflow_tests/test.test.ts index dc5a61ec05ee..fabb238784b8 100644 --- a/workflow_tests/test.test.ts +++ b/workflow_tests/test.test.ts @@ -5,7 +5,7 @@ import path from 'path'; import assertions from './assertions/testAssertions'; import mocks from './mocks/testMocks'; import ExtendedAct from './utils/ExtendedAct'; -import utils from './utils/utils'; +import * as utils from './utils/utils'; jest.setTimeout(90 * 1000); let mockGithub: MockGithub; @@ -54,7 +54,6 @@ describe('test workflow test', () => { const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new ExtendedAct(repoPath, workflowPath); - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); const testMockSteps: MockStep = { jest: mocks.TEST__JEST__STEP_MOCKS, @@ -75,7 +74,6 @@ describe('test workflow test', () => { const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new ExtendedAct(repoPath, workflowPath); - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); const testMockSteps: MockStep = { jest: mocks.TEST__JEST__STEP_MOCKS, @@ -103,7 +101,6 @@ describe('test workflow test', () => { const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new ExtendedAct(repoPath, workflowPath); - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); const testMockSteps: MockStep = { jest: mocks.TEST__JEST__STEP_MOCKS, @@ -124,7 +121,6 @@ describe('test workflow test', () => { const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new ExtendedAct(repoPath, workflowPath); - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); const testMockSteps: MockStep = { jest: mocks.TEST__JEST__STEP_MOCKS, @@ -150,7 +146,6 @@ describe('test workflow test', () => { const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new ExtendedAct(repoPath, workflowPath); - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); const testMockSteps: MockStep = { jest: mocks.TEST__JEST__STEP_MOCKS, @@ -171,7 +166,6 @@ describe('test workflow test', () => { const repoPath = mockGithub.repo.getPath('testTestWorkflowRepo') ?? ''; const workflowPath = path.join(repoPath, '.github', 'workflows', 'test.yml'); let act = new ExtendedAct(repoPath, workflowPath); - // @ts-expect-error TODO: Remove this once utils (https://github.com/Expensify/App/issues/32061) is migrated to TypeScript. act = utils.setUpActParams(act, event, eventOptions, {}, githubToken); const testMockSteps: MockStep = { jest: mocks.TEST__JEST__STEP_MOCKS, diff --git a/workflow_tests/utils/utils.ts b/workflow_tests/utils/utils.ts index dcc04aee02de..2012d2885802 100644 --- a/workflow_tests/utils/utils.ts +++ b/workflow_tests/utils/utils.ts @@ -4,8 +4,22 @@ import path from 'path'; import yaml from 'yaml'; import type ExtendedAct from './ExtendedAct'; +type Label = { + name: string; +}; + type EventOptions = { action?: string; + ref?: string; + // eslint-disable-next-line @typescript-eslint/naming-convention + ref_type?: string; + // eslint-disable-next-line @typescript-eslint/naming-convention + ref_name?: string; + type?: string; + label?: Label; + issue?: { + labels: Label[]; + }; }; type StepAssertionInputEntry = {key: string; value: string}; From eada5836332fd242310952f4b604ad8f275f1a78 Mon Sep 17 00:00:00 2001 From: VickyStash Date: Mon, 25 Mar 2024 18:50:20 +0100 Subject: [PATCH 7/9] Fix ts issues --- src/types/modules/act.d.ts | 14 +++++++++++++ workflow_tests/mocks/platformDeployMocks.ts | 2 +- workflow_tests/mocks/preDeployMocks.ts | 2 +- workflow_tests/mocks/testMocks.ts | 2 +- workflow_tests/utils/JobMocker.ts | 23 +++++++-------------- workflow_tests/utils/preGenerateTest.ts | 5 +++-- workflow_tests/utils/utils.ts | 21 ++----------------- 7 files changed, 29 insertions(+), 40 deletions(-) create mode 100644 src/types/modules/act.d.ts diff --git a/src/types/modules/act.d.ts b/src/types/modules/act.d.ts new file mode 100644 index 000000000000..5fe00ec479cf --- /dev/null +++ b/src/types/modules/act.d.ts @@ -0,0 +1,14 @@ +import type {StepIdentifier as ActStepIdentifier} from '@kie/act-js'; + +declare module '@kie/act-js' { + // eslint-disable-next-line rulesdir/no-inline-named-export + export declare type StepIdentifier = { + id?: string; + name: string; + run?: string; + mockWith?: string; + with?: string; + envs?: string[]; + inputs?: string[]; + } & Omit; +} diff --git a/workflow_tests/mocks/platformDeployMocks.ts b/workflow_tests/mocks/platformDeployMocks.ts index 1a14f488a81d..504510ac8962 100644 --- a/workflow_tests/mocks/platformDeployMocks.ts +++ b/workflow_tests/mocks/platformDeployMocks.ts @@ -269,7 +269,7 @@ const PLATFORM_DEPLOY__POST_GITHUB_COMMENT__STEP_MOCKS = [ PLATFORM_DEPLOY__POST_GIHUB_COMMENT__COMMENT__STEP_MOCK, ]; -export { +export default { PLATFORM_DEPLOY__VALIDATE_ACTOR__TEAM_MEMBER__STEP_MOCKS, PLATFORM_DEPLOY__VALIDATE_ACTOR__OUTSIDER__STEP_MOCKS, PLATFORM_DEPLOY__ANDROID__STEP_MOCKS, diff --git a/workflow_tests/mocks/preDeployMocks.ts b/workflow_tests/mocks/preDeployMocks.ts index d9da9d51bd85..12156a690804 100644 --- a/workflow_tests/mocks/preDeployMocks.ts +++ b/workflow_tests/mocks/preDeployMocks.ts @@ -80,7 +80,7 @@ const UPDATE_STAGING_JOB_MOCK_STEPS = [ const PREDEPLOY__E2EPERFORMANCETESTS__PERFORM_E2E_TESTS__MOCK_STEP = createMockStep('Perform E2E tests', 'Perform E2E tests', 'E2EPERFORMANCETESTS'); const PREDEPLOY__E2EPERFORMANCETESTS__MOCK_STEPS = [PREDEPLOY__E2EPERFORMANCETESTS__PERFORM_E2E_TESTS__MOCK_STEP]; -export { +export default { TYPECHECK_JOB_MOCK_STEPS, LINT_JOB_MOCK_STEPS, TEST_JOB_MOCK_STEPS, diff --git a/workflow_tests/mocks/testMocks.ts b/workflow_tests/mocks/testMocks.ts index cb8240169a8e..2d9527957b91 100644 --- a/workflow_tests/mocks/testMocks.ts +++ b/workflow_tests/mocks/testMocks.ts @@ -21,4 +21,4 @@ const TEST__SHELLTESTS__SETUP_NODE__STEP_MOCK = createMockStep('Setup Node', 'Se const TEST__SHELLTESTS__TEST_CI_GIT_LOGIC__STEP_MOCK = createMockStep('Test CI git logic', 'Test CI git logic', 'SHELLTESTS', [], []); const TEST__SHELLTESTS__STEP_MOCKS = [TEST__SHELLTESTS__CHECKOUT__STEP_MOCK, TEST__SHELLTESTS__SETUP_NODE__STEP_MOCK, TEST__SHELLTESTS__TEST_CI_GIT_LOGIC__STEP_MOCK]; -export {TEST__JEST__STEP_MOCKS, TEST__SHELLTESTS__STEP_MOCKS}; +export default {TEST__JEST__STEP_MOCKS, TEST__SHELLTESTS__STEP_MOCKS}; diff --git a/workflow_tests/utils/JobMocker.ts b/workflow_tests/utils/JobMocker.ts index b6dc99771dd2..dadb85014d01 100644 --- a/workflow_tests/utils/JobMocker.ts +++ b/workflow_tests/utils/JobMocker.ts @@ -1,3 +1,4 @@ +import type {StepIdentifier} from '@kie/act-js'; import type {PathOrFileDescriptor} from 'fs'; import fs from 'fs'; import path from 'path'; @@ -11,26 +12,16 @@ type YamlWorkflow = { }; type MockJob = { - steps: MockJobStep[]; + steps: StepIdentifier[]; uses?: string; secrets?: string[]; with?: string; - outputs?: string[]; - runsOn?: string; + outputs?: Record; + runsOn: string; }; type MockJobs = Record; -type MockJobStep = { - id?: string; - name: string; - run?: string; - mockWith?: string; - with?: string; - envs?: string[]; - inputs?: string[]; -}; - class JobMocker { workflowFile: string; @@ -59,8 +50,8 @@ class JobMocker { jobWith = job.with; delete job.with; } - job.steps = mockJob.steps.map((step) => { - const mockStep: MockJobStep = { + job.steps = mockJob.steps.map((step): StepIdentifier => { + const mockStep: StepIdentifier = { name: step.name, run: step.mockWith, }; @@ -114,4 +105,4 @@ class JobMocker { } export default JobMocker; -export type {MockJob, MockJobs, YamlWorkflow, YamlMockJob, MockJobStep}; +export type {MockJob, MockJobs, YamlWorkflow, YamlMockJob}; diff --git a/workflow_tests/utils/preGenerateTest.ts b/workflow_tests/utils/preGenerateTest.ts index 7698e618432d..c5e54d9a11c0 100644 --- a/workflow_tests/utils/preGenerateTest.ts +++ b/workflow_tests/utils/preGenerateTest.ts @@ -1,10 +1,11 @@ /* eslint no-console: ["error", { allow: ["warn", "log"] }] */ +import type {StepIdentifier} from '@kie/act-js'; import type {PathLike} from 'fs'; import fs from 'fs'; import path from 'path'; import {exit} from 'process'; import yaml from 'yaml'; -import type {MockJobStep, YamlMockJob, YamlWorkflow} from './JobMocker'; +import type {YamlMockJob, YamlWorkflow} from './JobMocker'; const workflowsDirectory = path.resolve(__dirname, '..', '..', '.github', 'workflows'); const workflowTestsDirectory = path.resolve(__dirname, '..'); @@ -97,7 +98,7 @@ describe('test workflow ${workflowName}', () => { }); `; -const mockStepTemplate = (stepMockName: string, step: MockJobStep, jobId: string | undefined) => ` +const mockStepTemplate = (stepMockName: string, step: StepIdentifier, jobId: string | undefined) => ` const ${stepMockName} = utils.createMockStep( '${step.name ?? ''}', '${step.name ?? ''}', diff --git a/workflow_tests/utils/utils.ts b/workflow_tests/utils/utils.ts index dfe74f417b30..143294b0745d 100644 --- a/workflow_tests/utils/utils.ts +++ b/workflow_tests/utils/utils.ts @@ -1,27 +1,10 @@ +import type {EventJSON} from '@kie/act-js/build/src/action-event/action-event.types'; import type {StepIdentifier} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; import fs from 'fs'; import path from 'path'; import yaml from 'yaml'; import type ExtendedAct from './ExtendedAct'; -type Label = { - name: string; -}; - -type EventOptions = { - action?: string; - ref?: string; - // eslint-disable-next-line @typescript-eslint/naming-convention - ref_type?: string; - // eslint-disable-next-line @typescript-eslint/naming-convention - ref_name?: string; - type?: string; - label?: Label; - issue?: { - labels: Label[]; - }; -}; - type StepAssertionInputEntry = {key: string; value: string}; type StepAssertion = { @@ -33,7 +16,7 @@ type StepAssertion = { function setUpActParams( act: ExtendedAct, event: string | null = null, - eventOptions: EventOptions | null = null, + eventOptions: EventJSON | null = null, secrets: Record | null = null, githubToken: string | null = null, envVars: Record | null = null, From 9c80827a582a372caa02214a4c5d217d8094d906 Mon Sep 17 00:00:00 2001 From: VickyStash Date: Mon, 25 Mar 2024 19:01:49 +0100 Subject: [PATCH 8/9] Code improvements --- package.json | 2 +- workflow_tests/lockDeploys.test.ts | 2 ++ workflow_tests/platformDeploy.test.ts | 9 ++++++--- workflow_tests/preDeploy.test.ts | 25 +++++++++++++----------- workflow_tests/reviewerChecklist.test.ts | 2 ++ workflow_tests/test.test.ts | 2 ++ 6 files changed, 27 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 0239b2a21635..c41afac9d570 100644 --- a/package.json +++ b/package.json @@ -154,8 +154,8 @@ "react-native-plaid-link-sdk": "10.8.0", "react-native-qrcode-svg": "^6.2.0", "react-native-quick-sqlite": "^8.0.0-beta.2", - "react-native-reanimated": "^3.7.2", "react-native-release-profiler": "^0.1.6", + "react-native-reanimated": "^3.7.2", "react-native-render-html": "6.3.1", "react-native-safe-area-context": "4.8.2", "react-native-screens": "3.29.0", diff --git a/workflow_tests/lockDeploys.test.ts b/workflow_tests/lockDeploys.test.ts index fe63d39d81cf..be739b963cbb 100644 --- a/workflow_tests/lockDeploys.test.ts +++ b/workflow_tests/lockDeploys.test.ts @@ -8,7 +8,9 @@ import ExtendedAct from './utils/ExtendedAct'; import * as utils from './utils/utils'; jest.setTimeout(90 * 1000); + let mockGithub: MockGithub; + const FILES_TO_COPY_INTO_TEST_REPO: CreateRepositoryFile[] = [ ...utils.deepCopy(utils.FILES_TO_COPY_INTO_TEST_REPO), { diff --git a/workflow_tests/platformDeploy.test.ts b/workflow_tests/platformDeploy.test.ts index 3866f07cefdc..57e4bcf1d26d 100644 --- a/workflow_tests/platformDeploy.test.ts +++ b/workflow_tests/platformDeploy.test.ts @@ -5,10 +5,13 @@ import path from 'path'; import assertions from './assertions/platformDeployAssertions'; import mocks from './mocks/platformDeployMocks'; import ExtendedAct from './utils/ExtendedAct'; +import type {MockJobs} from './utils/JobMocker'; import * as utils from './utils/utils'; jest.setTimeout(90 * 1000); + let mockGithub: MockGithub; + const FILES_TO_COPY_INTO_TEST_REPO: CreateRepositoryFile[] = [ ...utils.deepCopy(utils.FILES_TO_COPY_INTO_TEST_REPO), { @@ -102,7 +105,7 @@ describe('test workflow platformDeploy', () => { postSlackMessageOnSuccess: mocks.PLATFORM_DEPLOY__POST_SLACK_SUCCESS__STEP_MOCKS, postGithubComment: mocks.PLATFORM_DEPLOY__POST_GITHUB_COMMENT__STEP_MOCKS, }; - const testMockJobs = { + const testMockJobs: MockJobs = { deployChecklist: { steps: mocks.PLATFORM_DEPLOY__DEPLOY_CHECKLIST__STEP_MOCKS, runsOn: 'ubuntu-latest', @@ -186,7 +189,7 @@ describe('test workflow platformDeploy', () => { postSlackMessageOnSuccess: mocks.PLATFORM_DEPLOY__POST_SLACK_SUCCESS__STEP_MOCKS, postGithubComment: mocks.PLATFORM_DEPLOY__POST_GITHUB_COMMENT__STEP_MOCKS, }; - const testMockJobs = { + const testMockJobs: MockJobs = { deployChecklist: { steps: mocks.PLATFORM_DEPLOY__DEPLOY_CHECKLIST__STEP_MOCKS, runsOn: 'ubuntu-latest', @@ -270,7 +273,7 @@ describe('test workflow platformDeploy', () => { postSlackMessageOnSuccess: mocks.PLATFORM_DEPLOY__POST_SLACK_SUCCESS__STEP_MOCKS, postGithubComment: mocks.PLATFORM_DEPLOY__POST_GITHUB_COMMENT__STEP_MOCKS, }; - const testMockJobs = { + const testMockJobs: MockJobs = { deployChecklist: { steps: mocks.PLATFORM_DEPLOY__DEPLOY_CHECKLIST__STEP_MOCKS, runsOn: 'ubuntu-latest', diff --git a/workflow_tests/preDeploy.test.ts b/workflow_tests/preDeploy.test.ts index 2ddf761089f8..b75603c5e846 100644 --- a/workflow_tests/preDeploy.test.ts +++ b/workflow_tests/preDeploy.test.ts @@ -5,10 +5,13 @@ import path from 'path'; import assertions from './assertions/preDeployAssertions'; import mocks from './mocks/preDeployMocks'; import ExtendedAct from './utils/ExtendedAct'; +import type {MockJobs} from './utils/JobMocker'; import * as utils from './utils/utils'; jest.setTimeout(90 * 1000); + let mockGithub: MockGithub; + const FILES_TO_COPY_INTO_TEST_REPO: CreateRepositoryFile[] = [ ...utils.deepCopy(utils.FILES_TO_COPY_INTO_TEST_REPO), { @@ -71,7 +74,7 @@ describe('test workflow preDeploy', () => { skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, updateStaging: mocks.UPDATE_STAGING_JOB_MOCK_STEPS, }; - const testMockJobs = { + const testMockJobs: MockJobs = { typecheck: { steps: mocks.TYPECHECK_JOB_MOCK_STEPS, runsOn: 'ubuntu-latest', @@ -128,7 +131,7 @@ describe('test workflow preDeploy', () => { skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, updateStaging: mocks.UPDATE_STAGING_JOB_MOCK_STEPS, }; - const testMockJobs = { + const testMockJobs: MockJobs = { typecheck: { steps: mocks.TYPECHECK_JOB_MOCK_STEPS, runsOn: 'ubuntu-latest', @@ -232,7 +235,7 @@ describe('test workflow preDeploy', () => { skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, updateStaging: mocks.UPDATE_STAGING_JOB_MOCK_STEPS, }; - const testMockJobs = { + const testMockJobs: MockJobs = { typecheck: { steps: [utils.createMockStep('Run typecheck workflow', 'Running typecheck workflow - Typecheck workflow failed', 'TYPECHECK', null, null, null, null, false)], runsOn: 'ubuntu-latest', @@ -305,7 +308,7 @@ describe('test workflow preDeploy', () => { skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, updateStaging: mocks.UPDATE_STAGING_JOB_MOCK_STEPS, }; - const testMockJobs = { + const testMockJobs: MockJobs = { typecheck: { steps: mocks.TYPECHECK_JOB_MOCK_STEPS, runsOn: 'ubuntu-latest', @@ -376,7 +379,7 @@ describe('test workflow preDeploy', () => { skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, updateStaging: mocks.UPDATE_STAGING_JOB_MOCK_STEPS, }; - const testMockJobs = { + const testMockJobs: MockJobs = { typecheck: { steps: mocks.TYPECHECK_JOB_MOCK_STEPS, runsOn: 'ubuntu-latest', @@ -447,7 +450,7 @@ describe('test workflow preDeploy', () => { skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, updateStaging: mocks.UPDATE_STAGING_JOB_MOCK_STEPS, }; - const testMockJobs = { + const testMockJobs: MockJobs = { typecheck: { steps: mocks.TYPECHECK_JOB_MOCK_STEPS, runsOn: 'ubuntu-latest', @@ -503,7 +506,7 @@ describe('test workflow preDeploy', () => { skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, updateStaging: mocks.UPDATE_STAGING_JOB_MOCK_STEPS, }; - const testMockJobs = { + const testMockJobs: MockJobs = { typecheck: { steps: mocks.TYPECHECK_JOB_MOCK_STEPS, runsOn: 'ubuntu-latest', @@ -557,7 +560,7 @@ describe('test workflow preDeploy', () => { skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, updateStaging: mocks.UPDATE_STAGING_JOB_MOCK_STEPS, }; - const testMockJobs = { + const testMockJobs: MockJobs = { typecheck: { steps: mocks.TYPECHECK_JOB_MOCK_STEPS, runsOn: 'ubuntu-latest', @@ -623,7 +626,7 @@ describe('test workflow preDeploy', () => { skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, updateStaging: mocks.UPDATE_STAGING_JOB_MOCK_STEPS, }; - const testMockJobs = { + const testMockJobs: MockJobs = { typecheck: { steps: mocks.TYPECHECK_JOB_MOCK_STEPS, runsOn: 'ubuntu-latest', @@ -686,7 +689,7 @@ describe('test workflow preDeploy', () => { skipDeploy: mocks.SKIP_DEPLOY_JOB_MOCK_STEPS, updateStaging: mocks.UPDATE_STAGING_JOB_MOCK_STEPS, }; - const testMockJobs = { + const testMockJobs: MockJobs = { typecheck: { steps: mocks.TYPECHECK_JOB_MOCK_STEPS, runsOn: 'ubuntu-latest', @@ -752,7 +755,7 @@ describe('test workflow preDeploy', () => { updateStaging: mocks.UPDATE_STAGING_JOB_MOCK_STEPS, }; testMockSteps.updateStaging[3].mockWith = 'exit 1'; - const testMockJobs = { + const testMockJobs: MockJobs = { typecheck: { steps: mocks.TYPECHECK_JOB_MOCK_STEPS, runsOn: 'ubuntu-latest', diff --git a/workflow_tests/reviewerChecklist.test.ts b/workflow_tests/reviewerChecklist.test.ts index 04ab47cd955b..07b325f9d699 100644 --- a/workflow_tests/reviewerChecklist.test.ts +++ b/workflow_tests/reviewerChecklist.test.ts @@ -8,7 +8,9 @@ import ExtendedAct from './utils/ExtendedAct'; import * as utils from './utils/utils'; jest.setTimeout(90 * 1000); + let mockGithub: MockGithub; + const FILES_TO_COPY_INTO_TEST_REPO: CreateRepositoryFile[] = [ ...utils.deepCopy(utils.FILES_TO_COPY_INTO_TEST_REPO), { diff --git a/workflow_tests/test.test.ts b/workflow_tests/test.test.ts index fabb238784b8..331a657a486c 100644 --- a/workflow_tests/test.test.ts +++ b/workflow_tests/test.test.ts @@ -8,7 +8,9 @@ import ExtendedAct from './utils/ExtendedAct'; import * as utils from './utils/utils'; jest.setTimeout(90 * 1000); + let mockGithub: MockGithub; + const FILES_TO_COPY_INTO_TEST_REPO: CreateRepositoryFile[] = [ ...utils.deepCopy(utils.FILES_TO_COPY_INTO_TEST_REPO), { From e5f22b5559b44f0cc52658a0dc7390bb4475130c Mon Sep 17 00:00:00 2001 From: VickyStash Date: Tue, 26 Mar 2024 18:40:23 +0100 Subject: [PATCH 9/9] Fix TS issues --- workflow_tests/assertions/lockDeploysAssertions.ts | 2 +- workflow_tests/assertions/platformDeployAssertions.ts | 2 +- workflow_tests/assertions/reviewerChecklistAssertions.ts | 3 +-- workflow_tests/assertions/testAssertions.ts | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/workflow_tests/assertions/lockDeploysAssertions.ts b/workflow_tests/assertions/lockDeploysAssertions.ts index 278d413fb972..467e20bc5047 100644 --- a/workflow_tests/assertions/lockDeploysAssertions.ts +++ b/workflow_tests/assertions/lockDeploysAssertions.ts @@ -71,4 +71,4 @@ function assertlockStagingDeploysJobFailedAfterFirstStep(workflowResult: Step[]) }); } -export {assertlockStagingDeploysJobExecuted, assertlockStagingDeploysJobFailedAfterFirstStep}; +export default {assertlockStagingDeploysJobExecuted, assertlockStagingDeploysJobFailedAfterFirstStep}; diff --git a/workflow_tests/assertions/platformDeployAssertions.ts b/workflow_tests/assertions/platformDeployAssertions.ts index b164cd269b4c..a93abd77cca9 100644 --- a/workflow_tests/assertions/platformDeployAssertions.ts +++ b/workflow_tests/assertions/platformDeployAssertions.ts @@ -376,7 +376,7 @@ function assertPostGithubCommentJobExecuted(workflowResult: Step[], didExecute = }); } -export { +export default { assertVerifyActorJobExecuted, assertDeployChecklistJobExecuted, assertAndroidJobExecuted, diff --git a/workflow_tests/assertions/reviewerChecklistAssertions.ts b/workflow_tests/assertions/reviewerChecklistAssertions.ts index 6d74e27df1a0..4be8e1807dc7 100644 --- a/workflow_tests/assertions/reviewerChecklistAssertions.ts +++ b/workflow_tests/assertions/reviewerChecklistAssertions.ts @@ -13,5 +13,4 @@ function assertChecklistJobExecuted(workflowResult: Step[], didExecute = true) { }); } -// eslint-disable-next-line import/prefer-default-export -export {assertChecklistJobExecuted}; +export default {assertChecklistJobExecuted}; diff --git a/workflow_tests/assertions/testAssertions.ts b/workflow_tests/assertions/testAssertions.ts index e0d1d6b37022..06379403a834 100644 --- a/workflow_tests/assertions/testAssertions.ts +++ b/workflow_tests/assertions/testAssertions.ts @@ -54,4 +54,4 @@ function assertShellTestsJobExecuted(workflowResult: Step[], didExecute = true) }); } -export {assertJestJobExecuted, assertShellTestsJobExecuted}; +export default {assertJestJobExecuted, assertShellTestsJobExecuted};