Skip to content

Commit 05c0100

Browse files
committed
Update cypress config for WP-Env changes.
1 parent bb94b0f commit 05c0100

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

tests/cypress/config.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
const { defineConfig } = require('cypress');
2-
const { loadConfig } = require('@wordpress/env/lib/config');
3-
const getCacheDirectory = require('@wordpress/env/lib/config/get-cache-directory');
2+
const path = require('path');
3+
4+
// Resolve the package directory
5+
const wpEnvPackagePath = require.resolve('@wordpress/env/package.json');
6+
const wpEnvLibPath = path.join(path.dirname(wpEnvPackagePath), 'lib');
7+
8+
// Directly require the files using their resolved paths
9+
const { loadConfig } = require(path.join(wpEnvLibPath, 'config', 'index.js'));
10+
const getCacheDirectory = require(path.join(
11+
wpEnvLibPath,
12+
'config',
13+
'get-cache-directory.js'
14+
));
415

516
module.exports = defineConfig({
617
chromeWebSecurity: false,

0 commit comments

Comments
 (0)