Skip to content

Fix #41 test env wiring, add PR CI gates, and clean lint/type issues - #52

Merged
Vara-dev merged 1 commit into
code4recovery:mainfrom
Vara-dev:chore/issue-41-ci-gates-and-lint-fixes
Sep 5, 2026
Merged

Vara-dev merged 1 commit into
code4recovery:mainfrom
Vara-dev:chore/issue-41-ci-gates-and-lint-fixes

Conversation

@Vara-dev

@Vara-dev Vara-dev commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary:

  • Set deterministic Jest test env wiring by populating both MONGO_URI and MONGO_DB_NAME during global setup.
  • Add a reusable typecheck script for local and CI parity.
  • Add PR CI workflow that runs lint, typecheck, and tests with coverage so pull requests fail on quality regressions.
  • Add Jest global coverage thresholds to enforce a baseline in automated checks.
  • Apply manual lint/type safety fixes across Cypress/e2e utility and test env files (remove unused params, replace explicit any with safer types).
  • Align spec tests and string utility files with lint rules (quote style and ESM jest import consistency).

Details:

  • testEnv/setup.ts: set process.env.MONGO_DB_NAME = dbConfig.Database and use typed global instance access.
  • package.json: add "typecheck": "tsc --noEmit --project tsconfig.json".
  • .github/workflows/pr-ci.yml: new pull_request workflow on main with npm ci + lint + typecheck + test --coverage.
  • jest.config.ts: add coverageThreshold.global floors for branches/functions/lines/statements.
  • cypress.config.ts: remove unused setupNodeEvents params.
  • scripts/start-e2e-server.ts, testEnv/teardown.ts, BaseError.ts: strengthen types and remove explicit any.
  • meetings.controller.spec.ts and string utils files: lint-safe string quoting and jest import cleanup.

Validation:

  • Lint passes, typecheck passes, and tests pass with coverage (17/17 suites, 93/93 tests).

…/type issues

Summary:
- Set deterministic Jest test env wiring by populating both MONGO_URI and MONGO_DB_NAME during global setup.
- Add a reusable typecheck script for local and CI parity.
- Add PR CI workflow that runs lint, typecheck, and tests with coverage so pull requests fail on quality regressions.
- Add Jest global coverage thresholds to enforce a baseline in automated checks.
- Apply manual lint/type safety fixes across Cypress/e2e utility and test env files (remove unused params, replace explicit any with safer types).
- Align spec tests and string utility files with lint rules (quote style and ESM jest import consistency).

Details:
- testEnv/setup.ts: set process.env.MONGO_DB_NAME = dbConfig.Database and use typed global instance access.
- package.json: add "typecheck": "tsc --noEmit --project tsconfig.json".
- .github/workflows/pr-ci.yml: new pull_request workflow on main with npm ci + lint + typecheck + test --coverage.
- jest.config.ts: add coverageThreshold.global floors for branches/functions/lines/statements.
- cypress.config.ts: remove unused setupNodeEvents params.
- scripts/start-e2e-server.ts, testEnv/teardown.ts, BaseError.ts: strengthen types and remove explicit any.
- meetings.controller.spec.ts and string utils files: lint-safe string quoting and jest import cleanup.

Validation:
- User confirmed in WSL: lint passes (warning only), typecheck passes, and tests pass with coverage (17/17 suites, 93/93 tests).

Notes:
- Branch protection could not be applied from this account due READ-level repo permission; PR CI workflow is included so admins can require its check on main.

@tim-rohrer tim-rohrer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vara-dev, I really appreciate your work on this, and in cleaning up some code I'd left dirty.

I'm approving, with the understanding that you mentioned potentially adding check for OpenSpec. Maybe that is another PR after we get a little more comfortable with the new tool?

)
const scheduledCount = await db.collection("scheduled-meetings").countDocuments()
const unscheduledCount = await db.collection("unscheduled-meetings").countDocuments()
console.log(` ✅ Verified: ${scheduledCount} scheduled, ${unscheduledCount} unscheduled meetings`)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we're going to have some competing styling rules.

@Vara-dev
Vara-dev merged commit 20372be into code4recovery:main Sep 5, 2026
1 check passed
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