Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@
"update": "roll update",
"install:dev": "roll install --dev",
"update:dev": "roll update --dev",
"archive": "roll archive -y && rm -rf publish/tangible-fields && unzip -q publish/tangible-fields.zip -d publish/ && npm run now:test:archive",
"archive": "roll archive -y",
"jest:test": "jest --config=tests/jest/jest.config.js --silent=false test",
"now": "wp-now start --blueprint=blueprint.dev.json",
"now:dev": "concurrently --raw 'roll dev' 'npm run now'",
"now:test": "roll run tests/now/index.ts",
"now:test:archive": "roll run tests/now/index.ts TEST_ARCHIVE=1",
"-- Local environment --": "https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env",
"env": "wp-env",
"composer": "FOLDER=`basename $(realpath $PWD)`; wp-env run cli --env-cwd=wp-content/plugins/$FOLDER composer",
Expand Down Expand Up @@ -82,7 +78,6 @@
"@storybook/addon-onboarding": "^9.0.5",
"@storybook/builder-vite": "^9.0.17",
"@storybook/react-vite": "^9.0.17",
"@tangible/now": "^3.0.2",
"@tangible/roller": "^2.1.7",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0",
Expand Down
22 changes: 11 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ Format to code standard
npm run format
```

## Local test site
## Local dev site

Start a local test site using [`wp-now`](https://github.com/WordPress/playground-tools/blob/trunk/packages/wp-now/README.md).
Start a local dev site using [`wp-env`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/).

```sh
npm run start
```

For convenience, this also concurrently runs `npm run dev`.
For details see [Tests](#tests) below.

### Dev dependencies

Expand Down Expand Up @@ -145,32 +145,32 @@ Alternatively, you can use the [wp-env](https://developer.wordpress.org/block-ed
The test environment is started by running:

```sh
npm run env:start
npm run start
```

This uses [`wp-env`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/), which requires Docker to be installed. There are instructions available for installing Docker on [Windows](https://docs.docker.com/desktop/install/windows-install/), [macOS](https://docs.docker.com/desktop/install/mac-install/), and [Linux](https://docs.docker.com/desktop/install/linux-install/).

Visit [http://localhost:8888](http://localhost:8888) to see the dev site, and [http://localhost:8889](http://localhost:8880) for the test site, whose database is cleared on every run.
Visit [http://localhost:8888](http://localhost:8888) to see the dev site (default user `admin` with `password`); and [http://localhost:8889](http://localhost:8880) for the test site, whose database is cleared on every run.

Before running tests, install PHPUnit as a dev dependency using Composer in the container.

```sh
npm run env:composer:install
npm run composer:install
```

To run the tests:

```sh
npm run env:test:8.2
npm run env:test:7.4
npm run test:8.2
npm run test:7.4
```

The version-specific commands take a while to start, but afterwards you can run npm run env:test to re-run tests in the same environment.
The version-specific commands take a while to start, but afterwards you can run npm run test to re-run tests in the same environment.

To stop the Docker process:

```sh
npm run env:stop
npm run stop
```

To “destroy” and remove cache:
Expand All @@ -184,7 +184,7 @@ npm run env:destroy
To run more than one instance of `wp-env`, set different ports for the dev and test sites:

```sh
WP_ENV_PORT=3333 WP_ENV_TESTS_PORT=3334 npm run env:start
WP_ENV_PORT=3333 WP_ENV_TESTS_PORT=3334 npm run start
```

---
Expand Down
6 changes: 0 additions & 6 deletions tests/now/.wp-env.json

This file was deleted.

57 changes: 0 additions & 57 deletions tests/now/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions tests/now/plugin.php

This file was deleted.

Loading
Loading