Commit Graph

12 Commits

Author SHA1 Message Date
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
Andrew Datsenko a4a2c2867a Add jest-snapshot (#48095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48095

Changelog: [Internal]
Add `jest-snapshot` `v29.7.0`

Reviewed By: christophpurrer

Differential Revision: D66714069

fbshipit-source-id: 783584519e95b337d36c4a00610bcd970a041d4d
2024-12-09 19:09:57 -08:00
Rubén Norte 3cc67fed36 Add Fantom mode for development with Hermes bytecode (#48178)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48178

Changelog: [internal]

Adds a new mode for Fantom to run tests with dev-mode bytecode. Right now the modes were only dev (development with source code) or opt (optimized bytecode).

Reviewed By: rshest

Differential Revision: D66888986

fbshipit-source-id: 34b2566a65d138790e16f8fb5787fd9c2bcde536
2024-12-09 05:43:27 -08:00
Rubén Norte 4d07fb7662 Use enum for Fantom modes (#48179)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48179

Changelog: [internal]

Migrating this type to an enum, which is safer, because it prevents errors like:

```
// when it's actually 'dev'
if (mode === 'development') {

}
```

Reviewed By: rshest

Differential Revision: D66888985

fbshipit-source-id: 4f3f91fad6ca5256baa2123425b2bad11fe036f9
2024-12-09 05:43:27 -08:00
Rubén Norte 07a7b63fdd Only prewarm in CI (#48151)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48151

Changelog: [internal]

We have global setup step in Fantom to prewarm caches to properly attribute test running time, but this isn't necessary when running tests locally. Attribution isn't as important there. This disables the prewarming step so we can run individual tests as fast as we can.

Reviewed By: sammy-SC

Differential Revision: D66877990

fbshipit-source-id: 1f33c19a3c537c1c0e499fd7a6c405450cb9f86d
2024-12-09 05:43:27 -08:00
Rubén Norte 82abba9936 Implement warmup for optimized mode (#48150)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48150

Changelog: [internal]

We're starting to have some Fantom tests that run in optimized mode, but we're not currently prewarming for that case. This adds that capability to do proper attribution of run time for tests.

Reviewed By: javache

Differential Revision: D66877991

fbshipit-source-id: dccb80cd6a4f664de7df0661456bad78d960826d
2024-12-09 05:43:27 -08:00
Rubén Norte 47589f53b1 Add tests for Fantom modes (#48123)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48123

Changelog: [internal]

This verifies that the modes specified in the pragmas are applied correctly.

Reviewed By: andrewdacenko

Differential Revision: D66822377

fbshipit-source-id: 420f21f171c5d356ab91b49f7a33345386f6f0c0
2024-12-09 05:43:27 -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
Rubén Norte 923b194e47 Rename ReactNativeTester as just Fantom (#48142)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48142

Changelog: [internal]

This is the default export from the `react-native/fantom` package and it makes sense to be called that way. Also, this is similar to the `jest` global.

Reviewed By: javache

Differential Revision: D66874225

fbshipit-source-id: 8b43a637ebb42b5b1acb9ea5a6dbedd4c1a4f9e0
2024-12-06 05:24:31 -08:00
Rubén Norte 3fafc9f9cf Rename FantomRenderedOutput as getFantomRenderedOutput to follow convention (#48141)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48141

Changelog: [internal]

This just aligns the file name with the common convention to name modules with the same name as their default export (if any).

Reviewed By: javache

Differential Revision: D66874227

fbshipit-source-id: 2a619b434c26a29f1774cba1c32ba711b1a7af46
2024-12-06 05:24:31 -08:00
Rubén Norte ba8d184b77 Move render output tests to ReactNativeTester (#48140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48140

Changelog: [internal]

These tests test an API that's part of `ReactNativeTester` (will be renamed as `Fantom`) so it makes sense that they're in the same test file as the tests for the rest of the API.

Reviewed By: javache

Differential Revision: D66874226

fbshipit-source-id: f17e14c83cb5ca95ac619c5398c49ad84a27cfa5
2024-12-06 05:24:31 -08:00
Rubén Norte b253b0fe94 Create @react-native/fantom package (#48125)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48125

Changelog: [internal]

This just moves the runtime modules for Fantom to its own package.

Reviewed By: javache

Differential Revision: D66825478

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