Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
aa2cfa2
typings/plugin.d.ts: Create
nhooyr Oct 30, 2020
481df70
ci/dev/test.sh: Pass through args
nhooyr Oct 30, 2020
e08a55d
src/node/plugin.ts: Implement new plugin API
nhooyr Oct 30, 2020
bea185b
plugin: Add basic loading test
nhooyr Oct 30, 2020
82e8a00
Fix CI
nhooyr Oct 30, 2020
30d2962
src/node/plugin.ts: Warn on duplicate plugin and only load first
nhooyr Oct 30, 2020
ef97100
plugin.test.ts: Make it clear iconPath is a path
nhooyr Oct 30, 2020
f4d7f00
plugin.ts: Fixes for @wbobeirne
nhooyr Nov 3, 2020
75e52a3
plugin.ts: Fixes for @code-asher
nhooyr Nov 3, 2020
8d3a772
plugin.d.ts: Document plugin priority correctly
nhooyr Nov 3, 2020
6638daf
plugin.d.ts: Add explicit path field and adjust types to reflect
nhooyr Nov 3, 2020
fed545e
plugin.d.ts -> pluginapi.d.ts
nhooyr Nov 3, 2020
afff86a
plugin.ts: Adjust to implement pluginapi.d.ts correctly
nhooyr Nov 4, 2020
e03bbe3
routes/apps.ts: Implement /api/applications endpoint
nhooyr Nov 4, 2020
139a28e
plugin.ts: Describe private counterpart functions
nhooyr Nov 4, 2020
6870948
plugin.ts: Make application endpoint paths absolute
nhooyr Nov 4, 2020
2a13d00
plugin.ts: Add homepageURL to plugin and application
nhooyr Nov 4, 2020
af73b96
routes/apps.ts: Add example output
nhooyr Nov 4, 2020
706bc23
plugin: Fixes for CI
nhooyr Nov 4, 2020
8a8159c
plugin: More review fixes
nhooyr Nov 5, 2020
14f408a
plugin: Plugin modules now export a single top level identifier
nhooyr Nov 5, 2020
9453f89
plugin.ts: Fix usage of routerPath in mount
nhooyr Nov 5, 2020
197a09f
plugin: Test endpoints via supertest
nhooyr Nov 6, 2020
9d39c53
plugin: Give test-plugin some html to test overlay
nhooyr Nov 6, 2020
277211c
plugin: Make init and applications callbacks optional
nhooyr Nov 6, 2020
fe399ff
Fix formatting
nhooyr Nov 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
plugin: Give test-plugin some html to test overlay
  • Loading branch information
nhooyr committed Nov 6, 2020
commit 9d39c53c99eb5398ecd0df5a3ef0c0f8b3ec80c7
7 changes: 6 additions & 1 deletion test/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { PluginAPI } from "../src/node/plugin"
import * as supertest from "supertest"
import * as express from "express"
import * as apps from "../src/node/routes/apps"
import * as fs from "fs"
const fsp = fs.promises

/**
* Use $LOG_LEVEL=debug to see debug logs.
Expand Down Expand Up @@ -52,6 +54,9 @@ describe("plugin", () => {
})

it("/test-plugin/test-app", async () => {
await agent.get("/test-plugin/test-app").expect(200, { date: "2000-02-05T05:00:00.000Z" })
const indexHTML = await fsp.readFile(path.join(__dirname, "test-plugin/public/index.html"), {
encoding: "utf8",
})
await agent.get("/test-plugin/test-app").expect(200, indexHTML)
})
})
10 changes: 10 additions & 0 deletions test/test-plugin/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Test Plugin</title>
</head>
<body>
<p>Welcome to the test plugin!</p>
</body>
</html>
4 changes: 1 addition & 3 deletions test/test-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ export const plugin: pluginapi.Plugin = {
router() {
const r = express.Router()
r.get("/test-app", (req, res) => {
res.json({
date: new Date("2000/02/05"),
})
res.sendFile(fspath.resolve(__dirname, "../public/index.html"))
})
r.get("/goland/icon.svg", (req, res) => {
res.sendFile(fspath.resolve(__dirname, "../public/icon.svg"))
Expand Down