Repository navigation
Settings page regression tests (6/6): type-check and format-check the test suites in CI - #138
Merged
Merged
Conversation
- 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
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
# 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
…hecks Brings in #133 as merged, including its follow-up review changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9 # Conflicts: # packages/join-e2e/tests/admin-plan-redirect.spec.ts
The income guidance table (#125) added the plan page's first setValue calls. The page's useForm had no type, so TypeScript allowed no field names at all, and the type check this PR adds failed. Give it FormSchema, as the donation page does. Types only; nothing changes at runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StripePriceReuseTest (from #146) arrived with the merge of master. With phpcs and PHPStan now covering the tests: - Put the log stub's empty method bodies on their own lines (phpcbf). - Drop its CamelCaps phpcs:ignore comments; phpcs.xml excludes that rule for tests. - Reset Stripe's HTTP client to its default CurlClient rather than null, which the SDK's signature doesn't allow, as StripeInvoicePaidTest does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
PHPStan now covers the tests and reports that $argv might not be defined at file scope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Type-check the fake API strictly: JSDoc types for its requests, overrides and Stripe store, instead of turning off noImplicitAny and useUnknownInCatchVariables. A Stripe seed with bad JSON now gets a 400 rather than crashing the fake. - Stub $wpdb in SettingsMembershipPlanLookupTest with a plain class, as the other tests do. A Mockery double of \wpdb declared an empty global wpdb class, as WordPress isn't loaded in unit tests. - Merge the two CamelCapsMethodName rules in phpcs.xml into one. - Run the type check in the Jest job, which already installs join-flow's dependencies, instead of a separate job with its own install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
packages/join-flow)tsc --noEmit)packages/join-e2e)checkJsand JSDoc types)packages/join-block/tests)The type checks run in the Jest Tests workflow's Jest job (now "Jest tests and type check"), which already installs join-flow's dependencies, using the same root
npm run typecheckas local runs. Prettier's existing job now covers both JS packages. phpcs and PHPStan run in the existing PHP lint job viacomposer lint.Changes to get there
useFormis now typed withFormSchema, as the donation page's is. The income guidance table (JOIN-150 Add optional income guidance to the membership step #125) added the page's firstsetValuecalls, and with no type TypeScript allowed no field names, so the new type check failed on master's code.tsconfig.json, plustypescriptand@types/node(Node 20, matching CI) dev dependencies, and annpm run typecheckscript.strict..prettierrc.json(single quotes, 120 columns, trailing commas), matching how the tests were written. The repo's root settings would have restyled ~3,500 lines.$wpdbAPI (get_results,esc_like).phpcbf.wpdb; and resetting Stripe's HTTP client to its defaultCurlClientrather thannull, which the SDK's signature doesn't allow.npm run prettierformats both JS packages;npm run typecheckchecks both (it needsnpm --prefix packages/join-e2e cifirst).Testing
After merging master (via #134 to #137):
npm run typecheck,prettier --check packages/join-flow packages/join-e2e, andcomposer lintall pass.Generated by Claude Code