test-runners/released-plugin
Fetches a community plugin’s RELEASED build, so an integration test can install the real thing into a live vault rather than a stub standing in for it.
A plugin that depends on another plugin, or talks to one, needs this whenever a stub cannot prove what the test is there to prove: a stub emits what the plugin under test expects, not what the published plugin actually does. Only a released artifact settles whether the two agree.
A released asset, deliberately, and not a locally built one: it is the build a user installs, it pins to a version number the test can state, and it needs no checkout of the other repository to be present or buildable. The version is required, never latest: a test that silently follows a moving artifact stops being a statement about anything.
Downloads land in node_modules/.cache/obsidian-dev-toolkit/released-plugins/<plugin id>/<version> under the project root, so they need no .gitignore entry, a suite run after the first does no network I/O, and a pinned version is fetched exactly once.
Interfaces
Section titled “Interfaces”| Interface | Description |
|---|---|
| DownloadReleasedPluginParams | Parameters for downloadReleasedPlugin. |
| GetReleasedPluginPopulateParams | Parameters for getReleasedPluginPopulate. |
| ReleasedPluginFiles | The files an Obsidian plugin needs in its folder to be loaded. styles.css is deliberately absent: it is optional, and a release need not carry it. |
Functions
Section titled “Functions”| Function | Description |
|---|---|
| downloadReleasedPlugin | Reads a plugin’s released manifest.json and main.js, downloading them on first use. |
| getReleasedPluginPopulate | Builds the vault-relative file map that installs a plugin’s released build, and optionally its settings, ready to hand to a global setup’s populate or to merge into a larger map. Enabling it is the global setup’s enableCommunityPlugins. The result is assignable to obsidian-integration-testing’s PopulateFilesParams. |