From 0de3718770a889e5e5b95fe00f9b7e9a37ad452c Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Thu, 30 Apr 2020 14:01:42 -0300 Subject: [PATCH] change component name to e2e-environment --- .eslintrc.js | 2 +- babel.config.js | 2 +- docker-compose.yaml | 2 +- package-lock.json | 2 +- package.json | 10 +++++----- tests/e2e/config/jest.config.js | 2 +- tests/e2e/env/.travis.yml | 6 +++--- tests/e2e/env/README.md | 24 ++++++++++++------------ tests/e2e/env/bin/before-script-CI.sh | 2 +- tests/e2e/env/package.json | 4 ++-- tests/e2e/env/utils/app-root.js | 2 +- webpack.config.js | 2 +- 12 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 678ff545a52..d152f7b934a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,5 +1,5 @@ /** @format */ -const baseConfig = require( '@woocommerce/e2e-env' ).esLintConfig; +const baseConfig = require( '@woocommerce/e2e-environment' ).esLintConfig; module.exports = { ...baseConfig, diff --git a/babel.config.js b/babel.config.js index 3fd337adbe2..522ede3fe37 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,4 +1,4 @@ -const e2eBabelConfig = require( '@woocommerce/e2e-env' ).babelConfig; +const e2eBabelConfig = require( '@woocommerce/e2e-environment' ).babelConfig; module.exports = function( api ) { api.cache( true ); diff --git a/docker-compose.yaml b/docker-compose.yaml index f2625a55260..6fe0741783e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,7 +5,7 @@ services: wordpress-www: volumes: # This path is relative to the first config file - # which is in tests/e2e/env or node_modules/@woocommerce/e2e-env + # which is in tests/e2e/env or node_modules/@woocommerce/e2e-environment - "../../../:/var/www/html/wp-content/plugins/woocommerce" wordpress-cli: diff --git a/package-lock.json b/package-lock.json index db45df45dd5..b9814a8ead2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5005,7 +5005,7 @@ "@xtuc/long": "4.2.2" } }, - "@woocommerce/e2e-env": { + "@woocommerce/e2e-environment": { "version": "file:tests/e2e/env", "dev": true }, diff --git a/package.json b/package.json index 0042addca01..52817a25465 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,10 @@ "build": "grunt && npm run makepot", "build-watch": "grunt watch", "lint:js": "eslint assets/js --ext=js", - "docker:up": "npm explore @woocommerce/e2e-env -- npm run docker:up", - "docker:down": "npm explore @woocommerce/e2e-env -- npm run docker:down", - "test:e2e": "npm explore @woocommerce/e2e-env -- npm run test:e2e", - "test:e2e-dev": "npm explore @woocommerce/e2e-env -- npm run test:e2e-dev", + "docker:up": "npm explore @woocommerce/e2e-environment -- npm run docker:up", + "docker:down": "npm explore @woocommerce/e2e-environment -- npm run docker:down", + "test:e2e": "npm explore @woocommerce/e2e-environment -- npm run test:e2e", + "test:e2e-dev": "npm explore @woocommerce/e2e-environment -- npm run test:e2e-dev", "makepot": "composer run-script makepot", "packages:fix:textdomain": "node ./bin/package-update-textdomain.js", "git:update-hooks": "rm -r .git/hooks && mkdir -p .git/hooks && node ./node_modules/husky/husky.js install" @@ -28,7 +28,7 @@ "@babel/preset-env": "7.9.0", "@babel/register": "7.9.0", "@jest/test-sequencer": "^25.0.0", - "@woocommerce/e2e-env": "file:tests/e2e/env", + "@woocommerce/e2e-environment": "file:tests/e2e/env", "@wordpress/e2e-test-utils": "4.3.1", "autoprefixer": "9.7.5", "babel-eslint": "10.1.0", diff --git a/tests/e2e/config/jest.config.js b/tests/e2e/config/jest.config.js index b09817aeddf..cc3a355f4fd 100644 --- a/tests/e2e/config/jest.config.js +++ b/tests/e2e/config/jest.config.js @@ -1,5 +1,5 @@ const path = require( 'path' ); -const { jestConfig: baseE2Econfig } = require( '@woocommerce/e2e-env' ); +const { jestConfig: baseE2Econfig } = require( '@woocommerce/e2e-environment' ); module.exports = { ...baseE2Econfig, diff --git a/tests/e2e/env/.travis.yml b/tests/e2e/env/.travis.yml index 7fb5370a258..da739150a27 100644 --- a/tests/e2e/env/.travis.yml +++ b/tests/e2e/env/.travis.yml @@ -21,7 +21,7 @@ jobs: - bash bin/before-script-CI.sh - composer require wp-cli/i18n-command - npm run build - - npm explore @woocommerce/e2e-env -- npm run docker:up - - npm explore @woocommerce/e2e-env -- npm run test:e2e + - npm explore @woocommerce/e2e-environment -- npm run docker:up + - npm explore @woocommerce/e2e-environment -- npm run test:e2e after_script: - - npm explore @woocommerce/e2e-env -- npm run docker:down + - npm explore @woocommerce/e2e-environment -- npm run docker:down diff --git a/tests/e2e/env/README.md b/tests/e2e/env/README.md index 0389a1bceec..b8377eb636a 100644 --- a/tests/e2e/env/README.md +++ b/tests/e2e/env/README.md @@ -5,20 +5,20 @@ A reusable and extendable E2E testing environment for WooCommerce extensions. ## Installation ```bash -npm install @woocommerce/e2e-env --save +npm install @woocommerce/e2e-environment --save npm install jest --global ``` ## Configuration -The `@woocommerce/e2e-env` package exports configuration objects that can be consumed in JavaScript config files in your project. Additionally, it contains several files to serve as the base for a Docker container and Travis CI setup. +The `@woocommerce/e2e-environment` package exports configuration objects that can be consumed in JavaScript config files in your project. Additionally, it contains several files to serve as the base for a Docker container and Travis CI setup. ### Babel Config Extend your project's Babel config to contain the expected presets for E2E testing. ```js -const { babelConfig: e2eBabelConfig } = require( '@woocommerce/e2e-env' ); +const { babelConfig: e2eBabelConfig } = require( '@woocommerce/e2e-environment' ); module.exports = function( api ) { api.cache( true ); @@ -39,7 +39,7 @@ module.exports = function( api ) { The E2E environment uses Puppeteer for headless browser testing, which uses certain globals variables. Avoid ES Lint errors by extending the config. ```js -const { esLintConfig: baseConfig } = require( '@woocommerce/e2e-env' ); +const { esLintConfig: baseConfig } = require( '@woocommerce/e2e-environment' ); module.exports = { ...baseConfig, @@ -75,7 +75,7 @@ The E2E environment uses Jest as a test runner. Extending the base config is nee ```js const path = require( 'path' ); -const { jestConfig: baseE2Econfig } = require( '@woocommerce/e2e-env' ); +const { jestConfig: baseE2Econfig } = require( '@woocommerce/e2e-environment' ); module.exports = { ...baseE2Econfig, @@ -91,7 +91,7 @@ module.exports = { The E2E environment provides a `@woocommerce/e2e-tests` alias for easy use of the WooCommerce E2E test helpers. ```js -const { webpackAlias: coreE2EAlias } = require( '@woocommerce/e2e-env' ); +const { webpackAlias: coreE2EAlias } = require( '@woocommerce/e2e-environment' ); module.exports = { .... @@ -147,7 +147,7 @@ The E2E environment includes a base `.travis.yml` file that sets up a WordPress version: ~> 1.0 import: - - source: node_modules/@woocommerce/e2e-env/.travis.yml + - source: node_modules/@woocommerce/e2e-environment/.travis.yml mode: deep_merge_prepend # Merge the package config first. .... @@ -158,18 +158,18 @@ import: Start Docker ```bash -npm explore @woocommerce/e2e-env -- npm run docker:up +npm explore @woocommerce/e2e-environment -- npm run docker:up ``` Run E2E Tests ```bash -npm explore @woocommerce/e2e-env -- npm run test:e2e -npm explore @woocommerce/e2e-env -- npm run test:e2e-dev +npm explore @woocommerce/e2e-environment -- npm run test:e2e +npm explore @woocommerce/e2e-environment -- npm run test:e2e-dev ``` Stop Docker ```bash -npm explore @woocommerce/e2e-env -- npm run docker:down -``` \ No newline at end of file +npm explore @woocommerce/e2e-environment -- npm run docker:down +``` diff --git a/tests/e2e/env/bin/before-script-CI.sh b/tests/e2e/env/bin/before-script-CI.sh index bf3d828a274..d6a23a6d66b 100755 --- a/tests/e2e/env/bin/before-script-CI.sh +++ b/tests/e2e/env/bin/before-script-CI.sh @@ -10,7 +10,7 @@ fi if [[ ! -z "$WP_VERSION" ]] ; then composer install --no-dev - npm explore @woocommerce/e2e-env -- npm run install-wp-tests -- wc_e2e_tests root ' ' localhost $WP_VERSION + npm explore @woocommerce/e2e-environment -- npm run install-wp-tests -- wc_e2e_tests root ' ' localhost $WP_VERSION composer global require "phpunit/phpunit=4.8.*|5.7.*" fi diff --git a/tests/e2e/env/package.json b/tests/e2e/env/package.json index 0c3a03029a0..8102e4acb73 100644 --- a/tests/e2e/env/package.json +++ b/tests/e2e/env/package.json @@ -1,5 +1,5 @@ { - "name": "@woocommerce/e2e-env", + "name": "@woocommerce/e2e-environment", "version": "1.0.0", "description": "WooCommerce End to End Testing Environment Configuration.", "author": "Automattic", @@ -10,7 +10,7 @@ "e2e", "puppeteer" ], - "homepage": "https://github.com/woocommerce/woocommerce/tree/master/tests/e2e-env/README.md", + "homepage": "https://github.com/woocommerce/woocommerce/tree/master/tests/e2e/env/README.md", "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" diff --git a/tests/e2e/env/utils/app-root.js b/tests/e2e/env/utils/app-root.js index 2df91149a23..2e8b9e24506 100644 --- a/tests/e2e/env/utils/app-root.js +++ b/tests/e2e/env/utils/app-root.js @@ -5,7 +5,7 @@ const getAppRoot = () => { // Typically will be in node_modules/, but WooCommerce // uses a local file path (tests/e2e/env). let appPath = false; - const moduleDir = path.dirname( require.resolve( '@woocommerce/e2e-env' ) ); + const moduleDir = path.dirname( require.resolve( '@woocommerce/e2e-environment' ) ); if ( -1 < moduleDir.indexOf( 'node_modules' ) ) { appPath = moduleDir.split( 'node_modules' )[ 0 ]; diff --git a/webpack.config.js b/webpack.config.js index a4d39295d63..fc2c07c61de 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,4 @@ -const { webpackAlias: coreE2EAlias } = require( '@woocommerce/e2e-env' ); +const { webpackAlias: coreE2EAlias } = require( '@woocommerce/e2e-environment' ); module.exports = { resolve: {