mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 16:23:12 +09:00
Test for compatability with missing dependencies field in package.json
This commit is contained in:
1 parent
d7792ca369
commit
17133dc1f5
1 file changed
+16
@@ -198,6 +198,22 @@ describe("lib/plugin_loader", function() {
|
|||||||
assert.strictEqual(pluginList.get("monorepo-plugin"), monorepoPluginPathAbs);
|
assert.strictEqual(pluginList.get("monorepo-plugin"), monorepoPluginPathAbs);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should not throw when package.json has no dependencies field", async function() {
|
||||||
|
// Create a package.json without dependencies
|
||||||
|
await fs.outputFile(
|
||||||
|
path.join("package.json"),
|
||||||
|
JSON.stringify({
|
||||||
|
name: "test-package",
|
||||||
|
version: "1.0.0",
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// Should not throw
|
||||||
|
await assert.doesNotReject(async () => {
|
||||||
|
await lib.loadPluginList(pluginListPath, true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
after(async function() {
|
after(async function() {
|
||||||
process.chdir(old_cwd);
|
process.chdir(old_cwd);
|
||||||
await fs.remove(baseDir);
|
await fs.remove(baseDir);
|
||||||
|
|||||||
Reference in new issue
Block a user