Usage
Build your plugin and install its dependencies first. The owning repository must containisox.json. The plugin directory must expose compiled entry points from
its package.json; use dist/plugin if that is your standalone output package.
The example below assumes packages/plugin already resolves to a built package.
With Vitest installed in the test workspace:
writeJson to define the fixture’s project.json before
calling runIsox. The helper does not depend on Vitest: with Node’s test runner,
register t.after(workspace.cleanup); with other runners, use their teardown hook
or try/finally.
Options and result
createWorkspace(options?) discovers the nearest isox.json using core’s
findWorkspaceRoot, then creates a unique <workspace>/tmp/isox-e2e-* directory.
It writes a private package.json, but leaves workspace initialization to the
test so that isox init is exercised too.
Each directory must contain a
package.json with the matching name. @isox-sh/cli and
the CLI’s @isox-sh/core are supplied automatically and are reserved names in
plugins. cliDirectory lets you select a local CLI build instead of the bundled
dependency. Package discovery does not assume a monorepo directory layout.
The result exposes root, the CLI’s version, runIsox(args, cwd?),
runNode(args, cwd?), and cleanup(). Both command helpers return { stdout, stderr }, run without a shell, and reject on failure with command details,
captured output, and the original error as cause. The working directory defaults
to the fixture root. cleanup() removes only that fixture and can be called more
than once. Setup errors clean up automatically.
Package managers
The helper creates filesystem links (directory junctions on Windows), reusing each package’s already-installed dependencies. It does not invoke a package manager, install packages, use a global link registry, or access the network. This works with npm, pnpm, Yarn usingnodeLinker: node-modules, and Bun’s
node_modules installations. Yarn Plug’n’Play-only layouts are not supported by
this fixture mode; use Yarn’s node-modules linker for these tests.
file: directory dependencies require a package-manager install and do not have
uniform behavior: Yarn copies directory packages,
while pnpm installs their dependencies. Direct links
keep local builds and dependency resolution consistent without a fixture install.
These tests exercise built local packages, not packed or published artifacts.
Repository development
Runpnpm bootstrap, then pnpm isox test e2e for this package’s tests.
The repository’s init/build scenarios use this public API and run with
pnpm isox test js-e2e.