Remove mocks for yjs from the tests, and simplify the tests - #44
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| "eslint-plugin-storybook": "0.9.0", | ||
| "eslint-plugin-testing-library": "6.0.2", | ||
| "execa": "4.0.2", | ||
| "fake-indexeddb": "6.2.3", |
There was a problem hiding this comment.
This is necessary to mock indexdb properly in a node environment.
| // Polyfill structuredClone for jsdom environment (required by fake-indexeddb). | ||
| // Jest uses jsdom which doesn't include the structuredClone API yet. | ||
| // See: https://github.com/dumbmatter/fakeIndexedDB#jsdom-often-used-with-jest | ||
| import 'core-js/stable/structured-clone'; |
There was a problem hiding this comment.
As noted, this is due to a jsdom limitation.
|
Note: test failures are in the crdt section which has already been fixed in the upstream PR into core. When those changes are backported during a rebase, it'll be rectified. Also, the license failure is expected as well due to quill-delta. |
|
Size Change: 0 B Total Size: 1.96 MB ℹ️ View Unchanged
|
Description
Right now, the tests have extensive mocks in place for Yjs, and it's associated libraries to avoid depending on them. This is a problem for when we want to upgrade Yjs, as we can't quite rely on the tests to be accurate in calling out any breaking changes or subtle changes in behaviour.
This change will rectifies that, by swapping the mocks out for the real dependencies. It also simplifies the tests down, thanks to the mocks not being necessary anymore.