Skip to content

Commit

Permalink
Update wp-env version
Browse files Browse the repository at this point in the history
  • Loading branch information
kirtangajjar committed Jul 4, 2024
1 parent 0a82a88 commit 98d6346
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
18 changes: 11 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions tests/cypress/config.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 98d6346

Please sign in to comment.