diff --git a/package-lock.json b/package-lock.json index ff047351e..f472e27ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ }, "devDependencies": { "@10up/cypress-wp-utils": "^0.2.0", - "@wordpress/env": "^9.10.0", + "@wordpress/env": "^10.1.0", "@wordpress/scripts": "^26.19.0", "compare-versions": "^4.1.3", "cypress": "^13.1.0", @@ -4814,9 +4814,9 @@ } }, "node_modules/@wordpress/env": { - "version": "9.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-9.10.0.tgz", - "integrity": "sha512-GqUg1XdrUXI3l5NhHhEZisrccW+VPqJSU5xO1IXybI6KOvmSecidxWEqlMj26vzu2P5aLCWZcx28QkrrY3jvdg==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-10.2.0.tgz", + "integrity": "sha512-EToZYPGXpl42Asw3bxpX8aKmHfRUdGxKPjQ9CHZVQoTAL27Af4FyjyGnepsnDpnYdIeI8VPb2S3k2NL/1+fpIA==", "dev": true, "dependencies": { "chalk": "^4.0.0", @@ -4834,6 +4834,10 @@ }, "bin": { "wp-env": "bin/wp-env" + }, + "engines": { + "node": ">=18.12.0", + "npm": ">=8.19.2" } }, "node_modules/@wordpress/eslint-plugin": { @@ -24824,9 +24828,9 @@ } }, "@wordpress/env": { - "version": "9.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-9.10.0.tgz", - "integrity": "sha512-GqUg1XdrUXI3l5NhHhEZisrccW+VPqJSU5xO1IXybI6KOvmSecidxWEqlMj26vzu2P5aLCWZcx28QkrrY3jvdg==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-10.2.0.tgz", + "integrity": "sha512-EToZYPGXpl42Asw3bxpX8aKmHfRUdGxKPjQ9CHZVQoTAL27Af4FyjyGnepsnDpnYdIeI8VPb2S3k2NL/1+fpIA==", "dev": true, "requires": { "chalk": "^4.0.0", diff --git a/package.json b/package.json index 01b1e57be..c66efaa2a 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "@10up/cypress-wp-utils": "^0.2.0", - "@wordpress/env": "^9.10.0", + "@wordpress/env": "^10.1.0", "@wordpress/scripts": "^26.19.0", "compare-versions": "^4.1.3", "cypress": "^13.1.0", diff --git a/tests/cypress/config.js b/tests/cypress/config.js index 103de3a39..1d34e7abf 100644 --- a/tests/cypress/config.js +++ b/tests/cypress/config.js @@ -1,5 +1,6 @@ const { defineConfig } = require( 'cypress' ); -const { readConfig } = require( '@wordpress/env/lib/config' ); +const { loadConfig } = require( '@wordpress/env/lib/config' ); +const getCacheDirectory = require( '@wordpress/env/lib/config/get-cache-directory' ); module.exports = defineConfig( { chromeWebSecurity: false, @@ -34,7 +35,8 @@ module.exports = defineConfig( { * @return {Object} Updated Cypress Config object. */ const setBaseUrl = async ( on, config ) => { - const wpEnvConfig = await readConfig( 'wp-env' ); + const cacheDirectory = await getCacheDirectory(); + const wpEnvConfig = await loadConfig( cacheDirectory ); if ( wpEnvConfig ) { const port = wpEnvConfig.env.tests.port || null;