Add a test plugin without a module for the host tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-10-28 23:29:50 +00:00
1 parent 9ab36151bd
commit 6f70ccbf85
5 files changed
+22 -2

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
// Instance plugin without a module/ folder, for tests that need one.
export const plugin = {
name: "test_plugin_no_module",
title: "Test Plugin Without Module",
description: "Plugin used to test handling of plugins without a module.",
instanceEntrypoint: "instance.js",
};
@@ -0,0 +1 @@
export default async function() { }
@@ -0,0 +1,11 @@
{
"name": "test_plugin_no_module",
"version": "0.0.1",
"description": "Plugin without a Lua module used by the host tests",
"private": true,
"type": "module",
"main": "index.js",
"keywords": [
"clusterio-plugin"
]
}
+1 -1
View File
@@ -154,7 +154,7 @@ describe("host/create_scenario", function() {
await fs.cp(scenario, freeplay, { recursive: true });
pluginInfos = await lib.loadPluginInfos(new Map([
["research_sync", path.resolve("plugins/research_sync")],
["global_chat", path.resolve("plugins/global_chat")],
["test_plugin_no_module", path.resolve("test/file/test_plugin_no_module")],
]));
lib.addPluginConfigFields(pluginInfos);
hostConfig = new lib.HostConfig("host", { "host.factorio_directory": factorioDir });
+1 -1
View File
@@ -241,7 +241,7 @@ describe("host/patch", function() {
});
it("should skip plugins without a module", async function() {
const pluginInfos = await lib.loadPluginInfos(
new Map([["global_chat", path.resolve("plugins/global_chat")]])
new Map([["test_plugin_no_module", path.resolve("test/file/test_plugin_no_module")]])
);
const modules = await patch.loadModules(pluginInfos);
assert.deepEqual([...modules.keys()], ["clusterio"]);