Commit Graph

22 Commits

Author SHA1 Message Date
Asher
de11753569
Fill req.args for tests 2021-02-12 16:05:15 -06:00
Asher
de9491d5a6
Mark code-server as a virtual module 2021-02-10 13:13:23 -06:00
Asher
e098df0766
Fix code-server module not being provided in Jest 2021-02-09 15:23:08 -06:00
Asher
c78f56b334
Expose HttpError to plugins
This will let them throw and show nice errors more easily.
2021-02-09 13:09:38 -06:00
Asher
055e0ef9ec
Provide WsRouter to plugins 2021-02-09 13:09:27 -06:00
Asher
fb37473e72
Load only test plugin during tests
The other plugins in my path were causing the tests to fail.
2021-02-09 12:20:30 -06:00
Joe Previte
883dd13850
refactor: move jest and add package.json to /test 2021-01-21 14:06:49 -07:00
Joe Previte
cef7d42652
feat: setup jest 2021-01-21 10:10:32 -07:00
Anmol Sethi
64e915de4a
test: Rename testutil.ts to httpserver.ts 2021-01-20 02:06:44 -05:00
Anmol Sethi
8acb2aec11
plugin.test.ts: Switch to testutil.HttpServer 2021-01-20 02:06:43 -05:00
Anmol Sethi
fe399ff0fe
Fix formatting 2020-11-06 14:47:08 -05:00
Anmol Sethi
9d39c53c99
plugin: Give test-plugin some html to test overlay 2020-11-06 14:47:08 -05:00
Anmol Sethi
197a09f0c1
plugin: Test endpoints via supertest
Unfortunately we can't use node-mocks-http to test a express.Router
that has async routes. See https://github.com/howardabrams/node-mocks-http/issues/225

router will just return undefined if the executing handler is async and
so the test will have no way to wait for it to complete. Thus, we have
to use supertest which starts an actual HTTP server in the background
and uses a HTTP client to send requests.
2020-11-06 10:13:01 -05:00
Anmol Sethi
2a13d003d3
plugin.ts: Add homepageURL to plugin and application 2020-11-06 10:12:47 -05:00
Anmol Sethi
687094802e
plugin.ts: Make application endpoint paths absolute 2020-11-06 10:12:46 -05:00
Anmol Sethi
139a28e0ea
plugin.ts: Describe private counterpart functions
Addresses Will's comments.
2020-11-06 10:12:46 -05:00
Anmol Sethi
afff86ae9c
plugin.ts: Adjust to implement pluginapi.d.ts correctly 2020-11-06 10:12:46 -05:00
Anmol Sethi
75e52a3774
plugin.ts: Fixes for @code-asher 2020-11-06 10:12:46 -05:00
Anmol Sethi
ef971009d9
plugin.test.ts: Make it clear iconPath is a path 2020-11-06 10:12:46 -05:00
Anmol Sethi
30d2962e21
src/node/plugin.ts: Warn on duplicate plugin and only load first 2020-11-06 10:12:46 -05:00
Anmol Sethi
82e8a00a0d
Fix CI 2020-11-06 10:12:46 -05:00
Anmol Sethi
bea185b8b2
plugin: Add basic loading test
Will work on testing overlay next.
2020-11-06 10:12:46 -05:00