Archived
1
0
Commit Graph

87 Commits

Author SHA1 Message Date
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
Asher
a8e928798b
Re-export express for plugins 2021-02-09 12:19:38 -06:00
Asher
5f1fab7d27
Re-export logger field for plugins 2021-02-09 12:19:36 -06:00
Joe Previte
7f629c3675
Merge pull request #2671 from cdr/add-unit-tests
feat(testing): add unit tests for common/util
2021-02-08 11:32:55 -07:00
Anmol Sethi
c08e3bb06d
Add /absproxy to remove --proxy-path-passthrough
See https://github.com/cdr/code-server/issues/2222#issuecomment-765235938

Makes way more sense.
2021-02-05 11:44:34 -05:00
Joe Previte
4f6efced68
feat: add tests for getOptions 2021-02-04 15:18:44 -07:00
Joe Previte
323339d15a
feat: add jsdom for browser-ish tests 2021-02-04 15:18:43 -07:00
Joe Previte
3cebfcd447
feat: add tests for logError 2021-02-04 15:18:43 -07:00
Joe Previte
71cf459ece
feat: add tests for common/util 2021-02-04 15:18:43 -07:00
Joe Previte
6685a3e364
feat: update workflow 2021-02-01 15:11:45 -07:00
Joe Previte
66fe663e33
feat: add playwright 2021-02-01 15:11:28 -07:00
Anmol Sethi
966e9cc238
Merge pull request #2609 from cdr/proxy-res-d629
Fix body proxying, redirect proxying and add tests
2021-02-01 11:39:44 -05:00
Anmol Sethi
a60f61f9b3
proxy.test.ts: Add POST body test and redirection tests
Closes #2377
2021-02-01 11:16:52 -05:00
Anmol Sethi
d7f06975a6
test: Switch from leaked-handles to wtfnode (#2604)
See my comments at
https://github.com/cdr/code-server/pull/2563#issuecomment-763394741
2021-02-01 11:06:49 -05:00
Joe Previte
102f51ce1f
fix: surpress console log in cli test 2021-01-25 16:34:43 -07:00
Joe Previte
3044224729
feat: add support for code coverage shield 2021-01-25 16:21:07 -07:00
Joe Previte
05beccf671
refactor: move jest around and add code coverage 2021-01-22 14:18:45 -07:00
Joe Previte
883dd13850
refactor: move jest and add package.json to /test 2021-01-21 14:06:49 -07:00
Joe Previte
850c7e1a91
fix: add void for resolve in socket test 2021-01-21 10:11:10 -07:00
Joe Previte
0a07d67c8d
fix: prevent mocha/jest types conlict
Modify the tsconfig.json in lib/vscode/src/build.

This adds the flag skipLibCheck: true to tell TypeScript
to not type-check the declaration files at build time.

We need to add this because otherwise it checks the declaration
files and reports an error of duplicate type definitions
because we use Jest for our tests and they use Mocha and they
both use the global namespace "test" in their .d.ts files.
2021-01-21 10:11:09 -07:00
Joe Previte
de7d0394ae
refactor: tests from mocha to jest 2021-01-21 10:10:32 -07:00
Joe Previte
cef7d42652
feat: setup jest 2021-01-21 10:10:32 -07:00
Anmol Sethi
c32d8b155f
heart.ts: Fix leak when server closes
This had me very confused for quite a while until I did a binary search
inspection on route/index.ts. Only with the heart.beat line commented
out did my tests pass without leaking.

They weren't leaking fds but just this heartbeat timer and node of
course prints just fds that are active when it detects some sort of leak
I guess and that made the whole thing very confusing. These fds are not
leaked and will close when node's event loop detects there are no more
callbacks to run.

no of handles 3

tcp stream {
  fd: 20,
  readable: false,
  writable: true,
  address: {},
  serverAddr: null
}

tcp stream {
  fd: 22,
  readable: false,
  writable: true,
  address: {},
  serverAddr: null
}

tcp stream {
  fd: 23,
  readable: true,
  writable: false,
  address: {},
  serverAddr: null
}

It kept printing the above text again and again for 60s and then the
test binary times out I think. I'm not sure if it was node printing the
stuff above or if it was a mocha thing. But it was really confusing...

cc @code-asher for thoughts on what was going on.

edit: It was the leaked-handles import in socket.test.ts!!!
Not sure if we should keep it, this was really confusing and misleading.
2021-01-20 02:06:44 -05:00
Anmol Sethi
5c06646f58
Formatting and linting fixes 2021-01-20 02:06:44 -05:00
Anmol Sethi
60233d0974
test/proxy.test.ts: Implement 2021-01-20 02:06:44 -05:00
Anmol Sethi
240c8e266e
test: Implement integration.ts for near full stack integration testing 2021-01-20 02:06:44 -05:00
Anmol Sethi
64e915de4a
test: Rename testutil.ts to httpserver.ts 2021-01-20 02:06:44 -05:00
Anmol Sethi
d3074278ca
app.ts: Fix createApp to log all http server errors
cc @code-asher
2021-01-20 02:06:43 -05:00
Anmol Sethi
8acb2aec11
plugin.test.ts: Switch to testutil.HttpServer 2021-01-20 02:06:43 -05:00
Anmol Sethi
ea1949e440
test: Add testutil.HttpServer
The goal is to remove supertest as it does not support typescript well
and there's really no good reason for the dependency. Also no websocket
testing support.
2021-01-20 02:06:43 -05:00
Anmol Sethi
60c270aef5
cli: hashedPassword -> hashed-password (#2454)
Capital letters in the CLI are evil.

cc @code-asher
2020-12-18 12:20:38 -05:00
Joe Previte
b1282b9707
refactor: fix bug in --home test 2020-12-14 16:23:35 -07:00
Joe Previte
8daba6ca80
feat: add home as a cli option 2020-12-14 16:23:35 -07:00
SPGoding
1dd7e4b4e1
Add hashedPassword config (#2409)
Resolve #2225.
2020-12-08 14:54:17 -06:00
Anmol Sethi
9917da068a
v3.7.0 2020-11-16 11:11:50 -05:00
Asher
96995b78d1
Update cert flag test 2020-11-12 12:29:41 -06:00
Asher
e1702a1d21
Merge branch master into code-asher/ch1385 2020-11-12 11:52:02 -06: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
14f408a837
plugin: Plugin modules now export a single top level identifier
Makes typing much easier. Addresse's Will's last comment.
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
fed545e67d
plugin.d.ts -> pluginapi.d.ts
More clear.
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