Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48048
Changelog: [Internal]
Some messages may contains multi line content, ie snapshot comparison, multiline strings comparison.
Fixing this by checking first code pointer in the stack and slicing from there.
Reviewed By: christophpurrer, rubennorte
Differential Revision: D66660107
fbshipit-source-id: 57cea02cf6aae3c24f351504c2e077b5a2de0761
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48040
Changelog: [internal]
We need more expectations for a new test we're writing. This just adds:
* `expect(received).toBeLessThanOrEqual(expected)`
* `expect(received).toBeGreaterThanOrEqual(expected)`
Reviewed By: sammy-SC
Differential Revision: D66601921
fbshipit-source-id: 0a73f7757117ed790b95796b259244c8259136b7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47994
Changelog: [internal]
This adds a few hacks to improve errors messages in Fantom tests. Before, we were only logging the error message. After this, we log the message and the full (unsymbolicated for now) stack, including a pretty print of the exact location of the error.
For errors thrown from `expect` functions, the stack trace is modified to remove the "infra" lines from the stack.
The next step is symbolicating the errors using source maps generated by metro.
Reviewed By: javache
Differential Revision: D66555063
fbshipit-source-id: 17bd23cb30429a17e99f13f934c45e001120bbb3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47700
Changelog: [internal]
Add support for the string parameter for `toThrow` to assert for specific error messages.
Reviewed By: sammy-SC
Differential Revision: D66118001
fbshipit-source-id: 8c04cd20d4ad17163ec0c7bf943c429507a97985
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47699
Changelog: [internal]
Implements a `jest.fn()` and a subset of methods in `expect` using them (`.toHaveBeenCalled()` and `.toHaveBeenCalledTimes()`).
Reviewed By: sammy-SC
Differential Revision: D66118002
fbshipit-source-id: 5422307d68967d7d8b4c4d5155a45926f8fc8cae
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47646
changelog: [internal]
In order to control scheduling of tests, test setup must be separated from test running. This is because of how internal scheduling of React Native is restricted until bundle is loaded via BufferedRuntimeExecutor. This is the reason for executing tests by calling global function `$$RunTests$$`. This is not a pretty solution but it is hidden within testing infrastructure and users of our test infra are not exposed to this.
There is a new method exposed to JavaScript: flushMessageQueue. This will flush everything that is inside of message queue. This is the queue where tasks are queued whenever RuntimeScheduler enqueues something by calling `runtimeExecutor_`.
Reviewed By: christophpurrer
Differential Revision: D65951894
fbshipit-source-id: 2e8e0c10fbeb998f4a51ee6d01ef229eb5f70448
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47615
Changelog: [internal]
Fixes `.not` not being applied in some cases, and no logging the "not" label in case of error, and `.toBe` being flipped.
Reviewed By: javache
Differential Revision: D65952221
fbshipit-source-id: 030c0597b661d34e6324d69e5676375150a74f2e