Skip to content

Macros (block and inline) don't work in the vitest/bun test environment #1741

@jsimonrichard

Description

@jsimonrichard

I was trying to set up some tests for a macro extension I'm working on using bun:test but they refuse to work.

When executing in a normal environment (using bun run index.ts) the extension works as expected, but when I run my tests (with bun test), the processor acts as if the extension was never registered (even though it's included when I call registry.getInlineMacros()). I tried it with vitest as well, with the same result.

I have set up a minimal reproducible example here: https://github.com/jsimonrichard/asciidoctor.js-macro-test-issue-mre

I'm not sure if this is a bug with the test runners, my setup, or asciidoctor.js. Do you have any idea whats changing between the two environments (normal and testing)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions