Skip to content

fix(e2e): opt dev server out of the OTP auth handshake for automation#182

Merged
antfu merged 1 commit into
antfu:mainfrom
antfubot:fix/e2e-tests
Jul 21, 2026
Merged

fix(e2e): opt dev server out of the OTP auth handshake for automation#182
antfu merged 1 commit into
antfu:mainfrom
antfubot:fix/e2e-tests

Conversation

@antfubot

Copy link
Copy Markdown
Contributor

Problem

The full e2e suite (pnpm test:e2e) fails on test/e2e/dev.spec.ts — every RPC call the SPA makes against the live dev server (including the initial payload fetch) is rejected:

[DF0036] RPC call to "nmi:get-payload" was rejected: the caller is not authorized.

devframe v0.7.5 gates RPC calls behind an interactive one-time-code handshake by default (the dev server prints a code / magic link that a human clicks). A headless Playwright browser has no way to complete that handshake, so the dev-mode tests time out waiting for the nav rail to mount.

Fix

  • Add a --auth / --no-auth flag to the node-modules-inspector dev command, mirroring devframe's own --no-auth convention, and forward it into createDevServer's flags bag (which is where devframe resolves the auth gate).
  • Have the e2e orchestrator start the dev server with --no-auth, since it's a trusted, single-purpose process serving only the local Playwright suite.

Production node-modules-inspector dev usage is unaffected — the flag defaults to true (auth enabled), matching devframe's default.

Verification

pnpm test:e2e — 28/28 passing (was 2 failing in dev.spec.ts).


🤖 Generated with the help of an agent.

devframe v0.7.5 gates RPC calls behind an interactive one-time-code
handshake by default. The e2e dev-mode server has no way to complete
that handshake headlessly, so every RPC call (including the initial
payload fetch) was rejected with DF0036, failing dev.spec.ts.

Add a --auth/--no-auth flag to the dev command (mirroring devframe's
own --no-auth convention) and use it from the e2e orchestrator.
@pkg-pr-new

pkg-pr-new Bot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/node-modules-inspector@182
npm i https://pkg.pr.new/node-modules-tools@182

commit: a3b63a3

@antfu
antfu merged commit 1eb7ebb into antfu:main Jul 21, 2026
9 of 10 checks passed
antfubot added a commit to antfubot/node-modules-inspector that referenced this pull request Jul 21, 2026
Merge origin/main (antfu#181 exclude dev dependencies filter, antfu#182 e2e OTP fix,
another own-repo module-type test fix) into this branch.

- FiltersOptionExcludes.vue: the new "Exclude Dev Dependencies" OptionItem
  applies the same FormCheckbox treatment (`:div="true"` on OptionItem) as
  its siblings.
- module-type.test.ts: main independently hit and fixed the same h3-became-
  ESM-only issue (swapping the "dual" fixture to `vue`) — take their fixture
  choice for consistency with upstream, keep this branch's more robust
  deterministic (file-relative, not hoist-order-dependent) resolution. `vue`
  resolves consistently regardless of which installed patch gets hoisted
  (same dual exports shape across 3.5.x), so no pinned devDependency needed;
  drop the now-unused tinyglobby one.

Verified: vue-tsc --noEmit, eslint, vitest (87/87) and pnpm build all pass;
live-checked the new Exclude Dev Dependencies checkbox renders and is
positioned correctly.

Created with the help of an agent.
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