mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 14:15:24 +00:00
fix: bundled plugins path for source runs and backend cleanup
This commit is contained in:
1 parent
b0a0ee3e00
commit
f803bfc140
51 files changed
+147
-163
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import path from "node:path";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { getBundledPluginsDir } from "../../plugins/paths.js";
|
||||
|
||||
describe("getBundledPluginsDir", () => {
|
||||
const saved = process.env.TERMIX_BUNDLED_PLUGINS_DIR;
|
||||
|
||||
afterEach(() => {
|
||||
if (saved === undefined) delete process.env.TERMIX_BUNDLED_PLUGINS_DIR;
|
||||
else process.env.TERMIX_BUNDLED_PLUGINS_DIR = saved;
|
||||
});
|
||||
|
||||
it("reads dist/plugins when run from source", () => {
|
||||
delete process.env.TERMIX_BUNDLED_PLUGINS_DIR;
|
||||
expect(getBundledPluginsDir()).toBe(
|
||||
path.resolve(process.cwd(), "dist", "plugins"),
|
||||
);
|
||||
});
|
||||
|
||||
it("honors the override", () => {
|
||||
process.env.TERMIX_BUNDLED_PLUGINS_DIR = "/somewhere/else";
|
||||
expect(getBundledPluginsDir()).toBe("/somewhere/else");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user