Skip to content

Conversation

niklasnatter
Copy link
Contributor

What's in this PR?

This PR updates the jest package from version 26 to version 27. See the official release blog for a list of changes between the versions.

@@ -9,7 +9,7 @@ jest.mock('../../stores/metadataStore', () => ({
getSchema: jest.fn(),
}));

test('Create a MemoryFormStore with schema', (done) => {
test('Create a MemoryFormStore with schema', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a test cannot return a promise and use the done callback at the same time anymore:
https://jestjs.io/blog/2021/05/25/jest-27#features-coming-with-breaking-changes

@@ -43,7 +43,7 @@
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.1",
"autoprefixer": "^9.8.6",
"babel-eslint": "^10.0.2",
"babel-jest": "^26.3.0",
"babel-jest": "^27.3.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately, it looks like the new jest-circus runner fails when comparing a normal array with an observable array now. this leads to a lot of errors like this when running the tests:

 FAIL  src/Sulu/Bundle/AdminBundle/Resources/js/containers/FieldBlocks/tests/FieldBlocks.test.js

  ● Should pass new value to the BlockCollection if value prop is updated

    expect(received).toEqual(expected) // deep equality

    Expected: [{"text": "One", "type": "default"}]
    Received: serializes to the same string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suspect that this problem could be solved by updating to a new version of mobx. but unfortunately we are stuck at version 4 until the next major release (see #6343) 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Affecting the end developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants