Commit Graph

22 Commits

Author SHA1 Message Date
Jan Kassens 14fcaf9791 cleanup feature flag enableFabricCompleteRootInCommitPhase (#49372)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49372

Changelog: [Internal]

Reviewed By: poteto

Differential Revision: D69473992

fbshipit-source-id: 6ed54f0fab45b95e47afa3ff343de061e7c40ce7
2025-02-12 13:12:07 -08:00
Andrew Datsenko 6ec1d9d843 Add .toMatch API (#49328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49328

Changelog: [Internal]
Add missing `.toMatch` expect API

Reviewed By: rubennorte

Differential Revision: D69462225

fbshipit-source-id: aefe02e6a1f8f15c8c30c26492fa926e7d6e4e8e
2025-02-11 11:21:33 -08:00
Andrew Datsenko 9799e34211 Add .toHaveLength (#49327)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49327

Changelog: [Internal]
Add missing `.toHaveLength` expect API

Reviewed By: rubennorte

Differential Revision: D69241817

fbshipit-source-id: 11c7f314a30fd1db3c00b8665b613d290d50ad81
2025-02-11 10:32:27 -08:00
Andrew Datsenko 1d5cdf10fc Add .nthCalledWith and .toHaveBeenNthCalledWith (#49221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49221

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: cortinico

Differential Revision: D69133125

fbshipit-source-id: fe4e54cbb3646c154108cee6ead9a64c3e75c1b7
2025-02-06 08:02:32 -08:00
Andrew Datsenko 2080f64f03 Add .lastCalledWith and .toHaveBeenLastCalledWith (#49210)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49210

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69131600

fbshipit-source-id: bf7a740a4e830c5ce3403d8489bc3439428ee7b4
2025-02-05 12:52:21 -08:00
Andrew Datsenko b30a5f8ab2 Add .toBeCalledWith and .toHaveBeenCalledWith (#49177)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49177

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69123826

fbshipit-source-id: 53c550970d1cd2434f52a400ad18c8611f187176
2025-02-05 10:51:08 -08:00
Andrew Datsenko 33ff0c4789 Update toBeCalled and toBeCalledTimes aliases (#49200)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49200

Changelog: [Internal]
Update to `toBeCalled` and `toBeCalledTimes` aliases - forward them using prototype so number of frames matches when thrown.

Reviewed By: rubennorte

Differential Revision: D69182276

fbshipit-source-id: c20469959dc2e0f5c3686c90e27cd80117ad5fb7
2025-02-05 08:26:50 -08:00
Andrew Datsenko 87bdfda020 Add .toContain and .toContainEqual (#49178)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49178

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69130272

fbshipit-source-id: 77f45c501444700b0839a5aa7fcff807ba70641c
2025-02-05 07:43:50 -08:00
Andrew Datsenko b0501a5be2 Add .toStrictEqual (#49176)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49176

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69123117

fbshipit-source-id: 11c326f7ac4df80852409a1c9d72c911ceff21f7
2025-02-04 13:52:57 -08:00
Andrew Datsenko a702238bed Add .toBeFalsy and .toBeTruthy (#49169)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49169

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69119852

fbshipit-source-id: dfda47dcc61f17ecbd205863d83b268005c74a83
2025-02-04 10:54:19 -08:00
Andrew Datsenko e0f514d860 Add .toBeDefined and .toBeUndefined (#49168)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49168

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69119330

fbshipit-source-id: 2da7643cd969587b3aabe17d8c9eb405bc814b7b
2025-02-04 09:11:00 -08:00
Andrew Datsenko 13b57781ba Add .toBeCalled and .toBeCalledTimes (#49165)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49165

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69118825

fbshipit-source-id: bed276d8ba544b2351157052c3b37ebcc7398129
2025-02-04 08:26:06 -08:00
Rubén Norte 7e12060420 Move Fantom-related specs to src/private/testing/fantom/specs (#49101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49101

Changelog: [internal]

We can move this out of the deprecated directory. Also added a `.npmignore` entry so this won't be published to npm with the package.

Reviewed By: lenaic

Differential Revision: D68896208

fbshipit-source-id: ec85236aeeabdc9abcd870f0f4c1322eeb3cc659
2025-02-03 09:15:31 -08:00
Rubén Norte 2f27327f33 Rename src/private/specs as src/private/specs_DEPRECATED (#49068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49068

Changelog: [internal]

Renamed directory to better signal it's deprecated and added README.md to clarify intent.

Reviewed By: huntie

Differential Revision: D68895998

fbshipit-source-id: 5bc70d0782194db27c27cc89cc402d99f11aafa4
2025-02-03 09:15:31 -08:00
Pieter De Baets 26afc804b7 Error when tests finish with pending tasks (#49032)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49032

Add a native API to validate the RuntimeScheduler has no pending tasks, and automatically validate after every test that there's no pending tasks left to execute.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D68797481

fbshipit-source-id: dbbef894a57bd29eb5a033ac8aaeedef770dcba2
2025-01-29 08:49:49 -08:00
Andrew Datsenko cf6b807745 Add support for (before|after)(Each|All) methods (#48820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48820

Changelog: [Internal]
Add capability to setup / teardown tests

Reviewed By: rubennorte

Differential Revision: D68454176

fbshipit-source-id: 93c19c91dfe2b8b98385547da24955fd31adbf0b
2025-01-23 09:45:21 -08:00
Rubén Norte 726a72328e Use structured output for Fantom logs and test results (#48369)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48369

Changelog: [internal]

This improves logs in Fantom by preserving the original log levels. It's also in preparation for adding support for log streaming in tests.

Reviewed By: javache

Differential Revision: D67600616

fbshipit-source-id: 1c4997d5e836a78327f33092527543fe025c90c6
2025-01-03 04:57:43 -08:00
Rubén Norte f20486cc77 Improve error messages in expect().toThrow(message) (#48430)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48430

Changelog: [internal]

This expectation currently prints a very generic message that is hard to parse, so this change improves it a bit to account for more cases. E.g.:
* Before: "Expected <function> to throw"
* After: "Expected <function> to throw with message 'foo', but threw with message 'bar'"

Reviewed By: rshest

Differential Revision: D67738146

fbshipit-source-id: 690f15971cec0e8a7b038eeacc9302c9f3edc323
2025-01-03 02:16:38 -08:00
Rubén Norte 06584241ba Fix ESLint warnings and remove from ignore list (#48291)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48291

Changelog: [internal]

`react-native-fantom` was added to `.eslintignore` when we upgraded to React 19 because we wanted to reduce the amount of warnings to ease the migration.

This re-enables ESLint for that directory and removes the warnings.

Reviewed By: cipolleschi

Differential Revision: D67283104

fbshipit-source-id: 4ec2363ceaff3cd7bd6e5d70e9588c3dd22d7d85
2024-12-16 09:19:55 -08:00
Andrew Datsenko a298ccabe2 Add snapshot update / delete capability (#48096)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48096

Changelog: [Internal]

Managing snapshot state internally by adding / updating snapshot data.

Reviewed By: christophpurrer

Differential Revision: D66707175

fbshipit-source-id: 0366d834eafa0ca702f03de0210392181fd90a58
2024-12-09 19:09:57 -08:00
Andrew Datsenko a8a136f3ef Add .toMatchSnapshot() (#48029)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48029

Changelog: [Internal]

Adding snapshot support for rendered output only for now.
This will only work if snapshot is created beforehand by hand.

# Next steps
* Create snapshot when no prior snapshot is available
* Pass and update if instructed

Reviewed By: christophpurrer

Differential Revision: D66601387

fbshipit-source-id: fe528cded43c5ba36d314bd9af8e3fb84b98ac3e
2024-12-09 19:09:57 -08:00
Rubén Norte 81fbd18410 Move remaining Fantom files to react-native-fantom (#48143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48143

Changelog: [internal]

Just a small cleanup to move `jest/integration/*` to `packages/react-native-fantom`, so everything related to Fantom (config, runner, runtime, etc.) is in the same directory.

Reviewed By: javache

Differential Revision: D66874763

fbshipit-source-id: 8b87d7320c7704f7ce6cd58761508193784f5ce2
2024-12-06 05:24:31 -08:00