woocommerce/bin/wp-env-with-wp-641.js
Jonathan Lane 8e2e7de7ce
Migrate Puppeteer test action from Blocks repo (#42733)
* Migrate Puppeteer test action from Blocks repo

* Update file path

* Use pnpm

* Use npm

* Updates based on feedback

* Comment out paths for testing

* Fix paths with working directory

* Use pnpm

* Fix missing pnpms

* npm instead

* Do use pnpm

* Update command

* Blocks wp-env config

* Update paths, config files

* Run test commands from blocks

* Config update

* Uncomment paths so that e2e checks only run on Blocks

---------

Co-authored-by: Jon Lane <jon.lane@automattic.com>
2023-12-13 16:01:34 -08:00

20 lines
758 B
JavaScript

const fs = require( 'fs' );
const path = require( 'path' );
const wpEnvRaw = fs.readFileSync(
path.join( __dirname, '../plugins/woocommerce-blocks/.wp-env.json' )
);
const wpEnv = JSON.parse( wpEnvRaw );
// Pin the core version to 6.2.2 for Jest E2E test so we can keep the test
// passing when new WordPress versions are released. We do this because we're
// moving to Playwright and will abandon the Jest E2E tests once the migration
// is complete.
wpEnv.core = 'WordPress/WordPress#6.4.1';
// We write the new file to .wp-env.override.json (https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/#wp-env-override-json)
fs.writeFileSync(
path.join( __dirname, '..', '.wp-env.override.json' ),
JSON.stringify( wpEnv )
);