Skip to content

test/unit/bundles/automations/markdown.test.ts fails: cannot find package 'dompurify' #368

@mgoldsborough

Description

@mgoldsborough

Summary

test/unit/bundles/automations/markdown.test.ts fails on a clean checkout with:

error: Cannot find package 'dompurify' from
'src/bundles/automations/ui/src/markdown.ts'
(fail) (unnamed)

The test imports src/bundles/automations/ui/src/markdown.ts, which imports dompurify. dompurify is not resolvable from the root node_modules after bun install — it appears to be declared only in the nested src/bundles/automations/ui/ package, which the root unit-test run doesn't have on its resolution path.

Repro

bun install
bun test test/unit/bundles/automations/markdown.test.ts
# → 0 pass, 1 fail (Cannot find package 'dompurify')

Reproduces on main with no local changes (confirmed on two separate checkouts). It's a single failing test in an otherwise-green bun run test:unit (3305 pass / 1 fail).

Impact

bun run test:unit (and therefore bun run verify) exits non-zero on a fresh checkout. Likely a missing root-level dev dependency or a test that should resolve dompurify from the bundle-UI package rather than the root.

Found during

Investigating #60 — incidental, unrelated to that fix.

Suggested fix

Either hoist dompurify to the root package.json devDependencies, or adjust the test/import so markdown.ts's deps resolve from src/bundles/automations/ui/. Confirm whether bun run build:bundles is a prerequisite for this test and, if so, gate or document it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions