Skip to content

Add test workflow and fix lockfile for npm ci - #128

Merged
gaurang404 merged 2 commits into
mainfrom
ci/test-workflow
Nov 12, 2026
Merged

gaurang404 merged 2 commits into
mainfrom
ci/test-workflow

Conversation

@gaurang404

@gaurang404 gaurang404 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Why?

Nothing runs the tests or the build on pull requests. The only check is the Kritika review, so Renovate PRs and feature PRs are merged untested.

Because nothing ran npm ci, nobody noticed that it has failed on main since April: commit 8adef3a ("Update vitest", #100) upgraded vitest to v4, which moved esbuild to 0.28.0 as a side effect; the lockfile lost esbuild's 26 @esbuild/* platform entries in the process. Publishing still works because the publish workflow uses npm install.

Changes

  1. .github/workflows/test.yaml: on every pull request and on pushes to main, runs npm ci, npm run build and npm test. It uses a dummy API_KEY and VERIFIED_EMAIL, since tests replay tapes and never call the real API. No secrets are exposed to Renovate PRs.
  2. package-lock.json: regenerated with npm install --package-lock-only. It only adds the 26 missing @esbuild/* entries; no versions change and nothing is removed. npm ci now succeeds.
  3. .github/workflows/test.yaml: after the build, loads dist/index.js (CJS) and dist/index.mjs (ESM) and creates a client, so a broken bundle fails CI. Tests only import src/.

After merge

Add test (the job name) as a required status check on main so a failing run blocks merging.

🤖 Generated with Claude Code

Run npm ci, build and tests on every pull request and on pushes to main.

Regenerate package-lock.json: commit 8adef3a (vitest 4) bumped esbuild to
0.28.0 but dropped its 26 @esbuild/* platform entries, so npm ci has failed
on main since April. Only those entries are added; no versions change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mailerlite-kritika

mailerlite-kritika Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Re-runViewConfidence Score: 5/5

[Low risk] The new workflow runs only on pull_request and pushes to main, with contents: read and dummy credentials, so it cannot reach secrets or publish. The lockfile hunks only add @esbuild platform entries at the already-locked 0.28.0, and the action pins (checkout and setup-node at v7) serve only this new test job, so a failure stays inside it.

Summary

Adds a PR test workflow and restores missing esbuild lockfile entries

The new .github/workflows/test.yaml runs npm ci, npm run build, a CJS and ESM smoke test of dist/, then npm test with dummy credentials on every PR and on pushes to main. package-lock.json gains the 26 @esbuild/* 0.28.0 platform entries so npm ci can succeed. The smoke test added since the last review loads dist/index.js and dist/index.mjs and checks that subscribers is constructed. That matches the default-export class in src/index.ts and the cjs+esm formats in tsup.config.ts. After merge, add the "Test" job as a required status check on main.

What's good

  • The workflow uses least-privilege contents: read and dummy credentials, so Renovate PRs expose no secrets.
  • The smoke test covers both built artifacts (CJS and ESM), which the unit tests never exercise.
Review context · 0/1 skills · 0/5 commands
  • Skills read: none
  • Commands run: none

Reviews (2) · Last reviewed commit: "Smoke-test built package in CI" · claude-sonnet-5-5

@gaurang404
gaurang404 merged commit 5b34097 into main Nov 12, 2026
2 checks passed
@gaurang404 gaurang404 self-assigned this Nov 12, 2026
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.

1 participant