Skip to content

build: app tests run against built diagram output, not source #911

Open

Description

@bpowers

The app's jsdom tests run against the built src/diagram/lib output, not the diagram source, so a diagram change can pass the app tests against a stale build.
In an rstest config, resolve.aliasStrategy: 'prefer-alias' turns off tsconfig paths resolution entirely (Rsbuild wires paths only under prefer-tsconfig), so any @simlin/* import without an explicit alias entry falls through to the package's exports map and its built lib/.
src/app/rstest.config.mts aliases @simlin/engine and @simlin/core to source but not @simlin/diagram.

Example

src/app/App.tsx, Home.tsx, Login.tsx, NewProject.tsx, and index-component.tsx import @simlin/diagram, @simlin/diagram/HostedWebEditor, and @simlin/diagram/ModelIcon.
App tests such as tests/app.test.tsx and tests/home.test.tsx load whatever is in src/diagram/lib at the time, with no warning.
The same gap existed in src/diagram for @simlin/core/* subpaths until #900 added prefix aliases.

Why it matters

A green app suite does not show that diagram source changes work in the app.
Nothing reports the fallback: resolution simply succeeds against the wrong file.
The src/core and src/server configs point at built lib/ on purpose, so do not "fix" those.

Fix

Add '@simlin/diagram$' (to src/diagram/index.ts) and a '@simlin/diagram' prefix alias to src/app/rstest.config.mts, matching how core is aliased there.
Alternative: a lint check that every @simlin/* import in a prefer-alias package has an alias entry; it would catch the next omission but cannot tell an intentional lib/ alias from a mistake, so it is probably not worth the machinery.

Pointers

  • src/app/rstest.config.mts, src/diagram/rstest.config.mts (the pattern to copy)
  • docs/dev/typescript.md (documents the prefer-alias behavior)

Activity

  1. added
    frontend
    on Oct 12, 2026
  2. changed the title [-]build: rstest 'prefer-alias' disables tsconfig paths, silently resolving unaliased @simlin/* imports to stale built lib/[/-] [+]build: app tests run against built diagram output, not source[/+] on Oct 12, 2026
  3. added
    bug
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfrontend

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions