@posit-dev/positron-test-electron
v0.0.3
Published
Download a real Positron build and run @vscode/test-electron-style extension-host integration tests against the live positron.* API.
Keywords
Readme
@posit-dev/positron-test-electron
Download Positron and run @vscode/test-electron-style extension-host
integration tests against the live positron.* API without building Positron from
source.
Supports macOS (
darwin-arm64,darwin-x64), Windows (win32-x64,win32-arm64), and Linux (linux-x64,linux-arm64).Windows/Linux caveat:
channel: 'daily'and pinnedversions work today. The latestchannel: 'stable'is not available yet — the first stable release built from the new archive workflow has not been cut. Until then, usedailyor pin aversionon Windows/Linux. (macOSstableworks.) See issue #2.
Install
npm install --save-dev @posit-dev/positron-test-electronUsage (programmatic)
import * as path from 'path';
import { runTests } from '@posit-dev/positron-test-electron';
async function main() {
const code = await runTests({
channel: 'daily', // or 'stable'; or pin: version: '2026.08.0-365'
extensionDevelopmentPath: path.resolve(__dirname, '../../'),
extensionTestsPath: path.resolve(__dirname, './suite/index.js'),
});
process.exit(code);
}
main();Usage (CLI)
npx positron-test-electron \
--channel daily \
--extension-development-path . \
--extension-tests-path ./out/test/index.jsOptions
| Option | CLI flag | Default | Meaning |
|---|---|---|---|
| channel | --channel | daily | stable → releases, daily → dailies |
| version | --version | latest | exact pin, e.g. 2026.08.0-365 (reproducible CI) |
| platform | --platform | host | darwin-arm64 | darwin-x64 | win32-x64 | win32-arm64 | linux-x64 | linux-arm64 |
| cachePath | --cache-path | .positron-test | cache root |
| extensionDevelopmentPath | --extension-development-path | — | required |
| extensionTestsPath | --extension-tests-path | — | required |
| disableExtensions | --enable-extensions (sets false) | true | isolate the extension under test; set false when tests need other extensions |
| launchArgs | after -- | see below | merged after the defaults |
Default launch args: --disable-extensions --skip-welcome --skip-release-notes, plus
a fresh temp --user-data-dir. When disableExtensions is false,
--disable-extensions is omitted so Positron's bundled extensions (language
runtimes, notebook export, etc.) load alongside the extension under test.
