mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 07:30:41 +09:00
Fix plugin version not being loaded
Load the version of the plugin from its package.json file and document this requirement in the writing plugins document.
This commit is contained in:
1 parent
c5a14db8ea
commit
1b0b245484
3 files changed
+23
-9
No files matched your search
+5
-1
@@ -54,6 +54,10 @@ describe("lib/plugin", function() {
|
||||
path.join(pluginPath, "info.js"),
|
||||
`module.exports = { name: "${infoName}" };`
|
||||
);
|
||||
await fs.outputFile(
|
||||
path.join(pluginPath, "package.json"),
|
||||
'{ "version": "0.0.1" }'
|
||||
);
|
||||
}
|
||||
|
||||
await writePlugin(testPlugin, "test");
|
||||
@@ -71,7 +75,7 @@ describe("lib/plugin", function() {
|
||||
it("should load test plugin", async function() {
|
||||
assert.deepEqual(
|
||||
await plugin.loadPluginInfos(new Map([["test", path.resolve(testPlugin)]])),
|
||||
[{ name: "test", requirePath: path.resolve(testPlugin) }]
|
||||
[{ name: "test", version: "0.0.1", requirePath: path.resolve(testPlugin) }]
|
||||
);
|
||||
});
|
||||
it("should reject on broken plugin", async function() {
|
||||
|
||||
Reference in new issue
Block a user