Skip to content

Commit 2388be3

Browse files
committed
Create a testing library for ui-extensions (proof of concept)
1 parent 482065f commit 2388be3

22 files changed

Lines changed: 1472 additions & 0 deletions

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,22 @@ jobs:
4242
- name: Lint
4343
run: yarn lint
4444

45+
test:
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: ./.github/workflows/actions/prepare
51+
52+
- name: Build packages
53+
run: yarn build
54+
55+
- name: Typecheck ui-extensions-tester (including tests)
56+
run: npx tsc --project packages/ui-extensions-tester/tsconfig.typecheck.json
57+
58+
- name: Test ui-extensions-tester
59+
run: npx loom test --no-watch packages/ui-extensions-tester/
60+
4561
test-build:
4662
runs-on: ubuntu-latest
4763

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
"options": {
1313
"printWidth": 50
1414
}
15+
},
16+
{
17+
"files": [
18+
"packages/ui-extensions-tester/**/README.md"
19+
],
20+
"options": {
21+
"printWidth": 50
22+
}
1523
}
1624
]
1725
}

AGENTS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# AGENTS.md
2+
3+
After every change, you must:
4+
5+
1. **Run `yarn build`** — rebuild any changed packages.
6+
2. **Run relevant tests** — ensure all affected test suites pass.
7+
3. **Check for type errors** — run the TypeScript compiler to verify there are no type errors.
8+
4. **Check for lint and formatting errors** — run the linter and formatter to ensure code quality.
9+
10+
## ui-extensions-tester
11+
12+
When working on `ui-extensions-tester`, ALWAYS read [packages/ui-extensions-tester/AGENTS.md](packages/ui-extensions-tester/AGENTS.md).

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,17 @@ These packages act as the public API Shopify is exposing for UI Extensions in ou
77
Though we are not accepting contributions, we’d still love to hear from you! If you have ideas for new components or APIs, please [raise an issue on this repo](https://github.com/Shopify/ui-extensions/issues/new/choose). We will also happily accept pull requests for fixing typos in the documentation. If you do raise an issue or PR on this repo, please read [the code of conduct](./CODE_OF_CONDUCT.md), which all contributors must adhere to.
88

99
Shopifolk looking to contribute fixes and new features to our UI extension APIs can follow the [versions and deploys guide](./documentation/versions-and-deploys.md).
10+
11+
## Development
12+
13+
Build all libraries:
14+
15+
```
16+
yarn build
17+
```
18+
19+
Run tests in a package:
20+
21+
```
22+
npx loom test --no-watch packages/ui-extensions-tester/
23+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# AGENTS.md
2+
3+
Implement every feature with TDD. See `./tests`.
4+
5+
After every change, run the relevant test suites in `examples/testing/*` to verify that example tests still pass.
6+
7+
Keep documentation up to date in both the package README (`packages/ui-extensions-tester/README.md`) and each surface-specific README:
8+
9+
- `packages/ui-extensions-tester/src/admin/README.md`
10+
- `packages/ui-extensions-tester/src/checkout/README.md`
11+
- `packages/ui-extensions-tester/src/customer-account/README.md`
12+
- `packages/ui-extensions-tester/src/point-of-sale/README.md`
13+
14+
Any change to exports, function signatures, or behavior must be reflected in the relevant docs.
15+
16+
Code blocks in README files are formatted at print width 50 via the root `.prettierrc` override. Run `npx prettier --write` on any changed README.

0 commit comments

Comments
 (0)