Skip to content

[ZEPPELIN-6685] Resolve the app's imports in the shell unit test setup - #5439

Open
voidmatcha wants to merge 1 commit into
apache:masterfrom
voidmatcha:vitest-shell-alias
Open

[ZEPPELIN-6685] Resolve the app's imports in the shell unit test setup#5439
voidmatcha wants to merge 1 commit into
apache:masterfrom
voidmatcha:vitest-shell-alias

Conversation

@voidmatcha

@voidmatcha voidmatcha commented Aug 27, 2026

Copy link
Copy Markdown
Member

What is this PR for?

vitest.shell.config.mts declares no resolve.alias, and Vite does not read the paths block in tsconfig.base.json, so a spec cannot reach application source:

Failed to resolve import "@zeppelin/interfaces" from "src/app/services/array-ordering.service.ts"

The failure is in the source, not the spec: most of src/ imports @zeppelin/* itself, so a relative import does not avoid it.

monaco-editor does not resolve either. It publishes no main and no exports (monaco-editor#4848); module names editor.main, which boots the full editor and fails under jsdom. Eleven files import it, two behind the @zeppelin/services barrel.

This adds the alias block, a spec that exercises it, and a note in AGENTS.md. Two entries differ from tsconfig.base.json:

  • @zeppelin/sdk and @zeppelin/visualization resolve to library source, not dist/, so a unit run does not wait on a build. projects/zeppelin-react/vitest.config.mts already does this for the SDK.
  • monaco-editor resolves to esm/vs/editor/editor.api.js.

What type of PR is it?

Improvement

Todos

None

What is the Jira issue?

ZEPPELIN-6685

How should this be tested?

npm run test:shell goes from 29 tests to 37. The new spec covers ArrayOrderingService: trash folder last, blank title falls back to Note <id>, folders before notes, same-kind nodes by display name.

It imports through the @zeppelin/services barrel so the chain reaches monaco and @zeppelin/sdk. Pointing any of monaco-editor, @zeppelin/sdk or the catch-all at a nonexistent path fails it. Nothing imports the sdk/* or visualization/* subpaths today, so those two are uncovered.

ng build --configuration production and ng lint both pass unchanged: only Vitest reads the config, and src/tsconfig.json excludes specs from the build.

Screenshots (if appropriate)

N/A

Questions:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

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