yjs / y-prosemirror

ProseMirror editor binding for Yjs
https://demos.yjs.dev/prosemirror/prosemirror.html
MIT License
339 stars 118 forks source link

Tests on master are failing #28

Closed tommoor closed 3 years ago

tommoor commented 3 years ago

Describe the bug npm run test fails on master, because tests run as part of prepublish it's not possible to publish the project. Seems similar to #25.

To Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/yjs/y-prosemirror.git
  2. cd y-prosemirror
  3. npm install
  4. npm run test

Expected behavior Tests on master should pass.

Screenshots image

Environment Information

dmonad commented 3 years ago

Thanks @tommoor

Took me some time to figure this out..

This module uses the Yjs testing framework to automatically generate test cases. This testing framework uses the .mjs module in yjs/src/index.js. But when requiring the yjs module, it resolves to yjs/dist/yjs.cjs. So we include the same library twice, which leads to fails when checking inheritance.

This would normally not be a problem. You can include Yjs several times without a problem. But you can't compare two different Yjs structures that were created using different yjs dependencies.

Anyway. It's fixed. I should document my work environment more...

Now you should just be able to clone this package and run npm run debug (browser debugging) or npm test for testing in nodejs (simulates the dom to run prosemirror).

tommoor commented 3 years ago

Great stuff, sorry I was no use in tracking down the core of the problem myself. The test failures aren't terribly useful with this framework you're using.

Sidenote: Do you have something against running the tests in CI here on GitHub? There are lots of free options for open source that would improve confidence in the project to see ✅ passing tests on PR's.