From 3800eaace24bc580276783e5624d5540964a957a Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Fri, 22 Mar 2024 10:07:35 +0100 Subject: [PATCH 1/2] Improve the fetch of the version of PS --- src/utils/testContext.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/utils/testContext.ts b/src/utils/testContext.ts index 494f5d3b..983013b4 100644 --- a/src/utils/testContext.ts +++ b/src/utils/testContext.ts @@ -32,18 +32,25 @@ export default { }, /** * Return the version of current PrestaShop (depending the env value `PS_VERSION`) + * * `1.7.8.11` => `7.8.11` + * * `1.7.8.x` => `7.8.99` + * * `8.0.1` => `8.0.1` + * * `8.0.x` => `8.0.99` + * * `` => `99.99.99` + * * `develop` => `99.99.99` + * * `nightly` => `99.99.99` * @returns string */ getPSVersion(): string { - if (!process.env.PS_VERSION) { - return '0.0.0'; - } - if (process.env.PS_VERSION === 'nightly') { + if (!process.env.PS_VERSION + || process.env.PS_VERSION === 'develop' + || process.env.PS_VERSION === 'nightly') { return '99.99.99'; } const version: string = process.env.PS_VERSION; return version + .replace(/\.x$/, '.99') .replace(/^1\.7\./, '7.'); }, }; From e02ae74145c0acd6c19a858c8b7bbbcaefb0f97d Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Fri, 22 Mar 2024 10:19:17 +0100 Subject: [PATCH 2/2] Bump version to 0.0.11 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cb73577c..4ae77743 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prestashop-core/ui-testing", - "version": "0.0.10", + "version": "0.0.11", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts",