Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/test/plugin.test.ts

41 lines
967 B
TypeScript
Raw Normal View History

import { logger } from "@coder/logger"
import * as assert from "assert"
2020-10-30 08:26:30 +01: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 22:24:06 +01:00
const apps = await papi.applications()
2020-10-30 08:26:30 +01:00
assert.deepEqual(
[
{
name: "Test App",
2020-10-30 08:26:30 +01:00
version: "4.0.0",
description: "This app does XYZ.",
iconPath: "/icon.svg",
2020-10-30 08:26:30 +01:00
plugin: {
name: "test-plugin",
version: "1.0.0",
modulePath: path.join(__dirname, "test-plugin"),
displayName: "Test Plugin",
description: "Plugin used in code-server tests.",
path: "/test-plugin",
2020-10-30 08:26:30 +01:00
},
},
2020-10-30 08:26:30 +01:00
],
apps,
)
})
})