← 输入框|github.com|刷新
Skip to content

Settings page regression tests (6/6): type-check and format-check the test suites in CI - #138

Open
conatus wants to merge 3 commits into
admin-e2e-logging-debugfrom
test-suite-type-checks
Open

conatus wants to merge 3 commits into
admin-e2e-logging-debugfrom
test-suite-type-checks

Conversation

@conatus

@conatus conatus commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Sixth and last of the settings page regression test PRs. Adds type checking and formatting checks to the test suites, so they stay tidy.

Stacked on #137 (the last PR that adds tests), so the checks cover the new settings tests too, not just what's on master today.

What CI now checks

Suite Before Now
Join form + Jest tests (packages/join-flow) Prettier Prettier, type check (tsc --noEmit; it already passed, CI just didn't run it)
E2E tests (packages/join-e2e) nothing Prettier, type check (strict)
PHPUnit tests (packages/join-block/tests) nothing (excluded from phpcs and PHPStan) phpcs, PHPStan (level 5, like the plugin)

The type checks run as a new Type check job in the Jest Tests workflow. Prettier's existing job now covers both JS packages. phpcs and PHPStan run in the existing PHP lint job via composer lint.

Changes to get there

  • E2E:
    • New tsconfig.json, plus typescript and @types/node dev dependencies, and an npm run typecheck script.
    • The E2E tests already type-checked under strict.
    • Its own .prettierrc.json (single quotes, 120 columns, trailing commas), matching how the tests were written. Formatting them changed about 160 lines. The repo's root settings would have restyled ~3,500.
  • PHP tests:
    • phpcs allows snake_case method names in tests, since the test doubles mirror WordPress's $wpdb API (get_results, esc_like).
    • The other 22 phpcs errors were whitespace, fixed by phpcbf.
    • PHPStan's 3 findings are fixed: an unused property; a Mockery double typed as wpdb; and resetting Stripe's HTTP client to its default CurlClient rather than null, which the SDK's signature doesn't allow.
  • Root scripts: npm run prettier formats both JS packages; npm run typecheck checks both.
  • Readme: the testing section is updated.

Testing

  • npm run typecheck, prettier --check packages/join-flow packages/join-e2e, and composer lint all pass.
  • PHPUnit passes: 205 tests.
  • A clean npm ci in packages/join-e2e installs from the updated lockfile.
  • E2E after reformatting: render and theme specs, plus the integration specs against the restarted fake API (26 tests), pass. The full suite runs in CI.

Generated by Claude Code

- Type check (new CI job): the join form and its Jest tests, and the E2E
  tests, which gain a tsconfig. Both already passed; CI didn't run either.
  `npm run typecheck` runs both.
- Prettier now checks packages/join-e2e as well as packages/join-flow.
  The E2E package gets its own settings matching how its tests were
  written (single quotes, 120 columns, trailing commas), so formatting it
  is a small change rather than a restyle.
- phpcs and PHPStan now cover the PHPUnit tests. phpcs allows snake_case
  method names there (test doubles mirror WordPress's $wpdb API); its
  other findings were whitespace, fixed with phpcbf. PHPStan's three
  findings are fixed: an unused property, a Mockery double typed as
  wpdb, and resetting Stripe's HTTP client to its default rather than
  null.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
Comment thread package.json Resolved
Comment thread .github/workflows/jest-tests.yml Resolved
Comment thread .github/workflows/jest-tests.yml Resolved
Comment thread packages/join-block/phpcs.xml Resolved
Comment thread packages/join-e2e/package.json Resolved
Comment thread packages/join-e2e/tsconfig.json Resolved
# Conflicts:
#	packages/join-e2e/tests/settings/integrations-logging.spec.ts
#	packages/join-e2e/tests/settings/logging-debug.spec.ts
#	packages/join-e2e/tests/settings/membership-plans.spec.ts
#	packages/join-e2e/tests/settings/theme.spec.ts
- Remove the CamelCaps phpcs:ignore comments in tests, which phpcs.xml
  now excludes for tests anyway.
- Mock wpdb by class, so the @var matches the real type.
- CI type check: skip the root postinstall (Composer), and run the root
  typecheck script rather than repeating its steps.
- Type-check the fake API (with a looser config, so plain JS needs no
  annotations), and pin @types/node to 20 to match CI's Node.
- Readme: the type check needs the E2E dependencies installed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
@conatus conatus changed the title Type-check and format-check the test suites in CI Settings page regression tests (6/6): type-check and format-check the test suites in CI Oct 25, 2026
@linear-code

linear-code Bot commented Oct 25, 2026

Copy link
Copy Markdown

JOIN-173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants