1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2024-12-27 12:45:25 +00:00
code-server-2/test/plugin.test.ts

41 lines
963 B
TypeScript
Raw Normal View History

import { logger } from "@coder/logger"
import * as assert from "assert"
2020-10-30 07:26:30 +00:00
import { describe } from "mocha"
import * as path from "path"
import { PluginAPI } from "../src/node/plugin"
/**
* Use $LOG_LEVEL=debug to see debug logs.
*/
describe("plugin", () => {
it("loads", async () => {
const papi = new PluginAPI(logger, path.resolve(__dirname, "test-plugin") + ":meow")
await papi.loadPlugins()
2020-11-03 21:24:06 +00:00
const apps = await papi.applications()
2020-10-30 07:26:30 +00:00
assert.deepEqual(
[
{
name: "test app",
2020-10-30 07:26:30 +00:00
version: "4.0.0",
description: "my description",
iconPath: "/icon.svg",
2020-10-30 07:26:30 +00:00
plugin: {
name: "test-plugin",
version: "1.0.0",
modulePath: path.join(__dirname, "test-plugin"),
description: "Plugin used in code-server tests.",
displayName: "Test Plugin",
path: "/test-plugin",
2020-10-30 07:26:30 +00:00
},
},
2020-10-30 07:26:30 +00:00
],
apps,
)
})
})