Q
Q
Quintis2021-02-17 16:11:46
JavaScript
Quintis, 2021-02-17 16:11:46

How to pass all the tests for a pull request in WordPress gutenberg editor?

Good day. Made a pull request to fix a bug in the gutenberg editor - https://github.com/WordPress/gutenberg/pull/29039 , but it didn't pass all the tests.
For example :

● FormTokenField › suggestions › suggestions that begin with match are boosted

    expect(jest.fn()).not.toHaveErrored(expected)

    Expected mock function not to be called but it was called with:
    ["Error: Uncaught [TypeError: Cannot create property 'label' on string 'sound']

      34 | 	function assertExpectedCalls() {
      35 | 		if ( spy.assertionsNumber === 0 && spy.mock.calls.length > 0 ) {
    > 36 | 			expect( console ).not[ matcherName ]();
         | 			^
      37 | 		}
      38 | 	}
      39 |

All tests - https://github.com/WordPress/gutenberg/pull/29039/...
1) Can someone explain how these tests work?
2) What do I need to change in the code to pass all the tests?
Thanks

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question