You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Are you reporting a bug? Use github issues for bug reports and feature requests. For general questions, please use https://discuss.yjs.dev/ [ ] Try to report your issue in the correct repository. Yjs consists of many modules. When in doubt, report it to https://github.com/yjs/yjs/issues/
Is your feature request related to a problem? Please describe. I wrote tests for a ws-server for y-websocket using lib0/testing (since I don't know any other testing-lib that works with esm). When I tried to run those tests, I got an error message regarding usage of window in y-websocket (from this line). These type of things prevent running y-websocket in a node.js environment and writing and running automated tests for it
Describe the solution you'd like y-websocket should be runnable on node.js. If some help is needed, then I can copy over the testing-code which tries to use y-websocket in node.js env from my private repo to a public repo, and that repo can be used to verify if y-websocket can be run on backend.
Describe alternatives you've considered not testing the ws server which y-websocket connects to is the only alternative, but it doesn't bring much confidence
[1/1] app: single doc
ReferenceError: window is not defined
at new WebsocketProvider (/home/k/Projects/proj/yjs-proto/sw/crdt-ws/node_modules/y-websocket/src/y-websocket.js:280:5)
at testSingleDoc (file:///home/k/Projects/proj/yjs-proto/sw/crdt-ws/src/__tests__/app.test.ts:17:22)
at run (file:///home/k/Projects/proj/yjs-proto/sw/crdt-ws/node_modules/lib0/testing.js:158:17)
at runTests (file:///home/k/Projects/proj/yjs-proto/sw/crdt-ws/node_modules/lib0/testing.js:552:27)
at file:///home/k/Projects/proj/yjs-proto/sw/crdt-ws/src/__tests__/main.ts:8:11
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Failure: single doc in 3.54ms
repeat: npm run test -- --filter "\[1/"
> 1 test failed
kapv89
changed the title
Make y-websocket run on node.js so that websocket server or y-websocket can be tested
Make y-websocket run on node.js so that websocket server for y-websocket can be tested
May 16, 2021
* Update README.md
* fix: Memory leak with old versions of yjs
Versions of yjs prior to `13.4.6` did not emit a `"destroy"` event when a doc is destroyed, meaning that doc's in the websocket servers memory are not correctly cleaned up.
* Update package-lock.json
* Extendable messageHanlers
* update deps
* 1.3.10
* remove node types from client code
* 1.3.11
* lint
* Add info about y-websocket-server to quick-start
* add on exit handler for Node.js environments
* 1.3.14
* Fix a `peerDependencies` typo in `package.json`
* fix typo
* Remove dependency on window - fixesyjs#65
* 1.3.12
* use condititional exports of dependencies
* 1.3.13
* set correct module type
* 1.3.14
* fixyjs#69 by reverting esm change
* 1.3.15
* Fix beforeunload memory leak
* 1.3.16
Co-authored-by: Kevin Jahns <[email protected]>
Co-authored-by: Tom Moor <[email protected]>
Co-authored-by: Kevin Jahns <[email protected]>
Co-authored-by: Hans Pagel <[email protected]>
Co-authored-by: Thomas Parisot <[email protected]>
Co-authored-by: Nemanja Tosic <[email protected]>
Checklist
[ ] Are you reporting a bug? Use github issues for bug reports and feature requests. For general questions, please use https://discuss.yjs.dev/ [ ] Try to report your issue in the correct repository. Yjs consists of many modules. When in doubt, report it to https://github.com/yjs/yjs/issues/
Is your feature request related to a problem? Please describe. I wrote tests for a ws-server for y-websocket using
lib0/testing
(since I don't know any other testing-lib that works with esm). When I tried to run those tests, I got an error message regarding usage ofwindow
in y-websocket (from this line). These type of things prevent running y-websocket in a node.js environment and writing and running automated tests for itDescribe the solution you'd like y-websocket should be runnable on node.js. If some help is needed, then I can copy over the testing-code which tries to use y-websocket in node.js env from my private repo to a public repo, and that repo can be used to verify if y-websocket can be run on backend.
Describe alternatives you've considered not testing the ws server which y-websocket connects to is the only alternative, but it doesn't bring much confidence
Additional context test-code:
error-message
Huly®: YJS-501
The text was updated successfully, but these errors were encountered: