Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import tseslint from 'typescript-eslint';
import callstackConfig from '@callstack/eslint-config/react-native.flat.js';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import jest from 'eslint-plugin-jest';

export default [
{
Expand Down Expand Up @@ -37,6 +38,9 @@ export default [
},
{
files: ['**/*.test.{ts,tsx}', 'src/test-utils/**'],
plugins: {
jest: jest,
},
rules: {
'react/no-multi-comp': 'off',
'react-native/no-color-literals': 'off',
Expand All @@ -46,6 +50,10 @@ export default [
'react-native-a11y/has-valid-accessibility-ignores-invert-colors': 'off',
'react-native-a11y/has-valid-accessibility-value': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'jest/no-standalone-expect': [
'error',
{ additionalTestBlockFunctions: ['testGateReact19'] },
],
},
},
];
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
"@babel/preset-react": "^7.25.9",
"@babel/preset-typescript": "^7.26.0",
"@callstack/eslint-config": "^15.0.0",
"@react-native/babel-preset": "0.79.1",
"@react-native/babel-preset": "0.80.1",
"@release-it/conventional-changelog": "^10.0.0",
"@relmify/jest-serializer-strip-ansi": "^1.0.2",
"@types/jest": "^30.0.0",
"@types/node": "^22.13.8",
"@types/react": "^19.0.0",
"@types/react-test-renderer": "^19.0.0",
"@types/react": "^19.1.0",
"@types/react-test-renderer": "^19.1.0",
"babel-jest": "^30.0.2",
"babel-plugin-module-resolver": "^5.0.2",
"del-cli": "^6.0.0",
Expand All @@ -87,10 +87,10 @@
"flow-bin": "~0.170.0",
"jest": "^30.0.2",
"prettier": "^2.8.8",
"react": "19.0.0",
"react-native": "0.79.1",
"react-native-gesture-handler": "^2.26.0",
"react-test-renderer": "19.0.0",
"react": "19.1.0",
"react-native": "0.80.1",
"react-native-gesture-handler": "^2.27.1",
"react-test-renderer": "19.1.0",
"release-it": "^18.0.0",
"typescript": "^5.6.3",
"typescript-eslint": "^8.19.1"
Expand Down
7 changes: 4 additions & 3 deletions src/__tests__/react-native-api.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { FlatList, Image, Modal, ScrollView, Switch, Text, TextInput, View } fro

import { render, screen } from '..';

const isReact19 = React.version.startsWith('19.');
const testGateReact19 = isReact19 ? test : test.skip;

/**
* Tests in this file are intended to give us an proactive warning that React Native behavior has
* changed in a way that may impact our code like queries or event handling.
Expand Down Expand Up @@ -214,7 +217,7 @@ test('React Native API assumption: <FlatList> renders a single host <ScrollView>
`);
});

test('React Native API assumption: <Modal> renders a single host element', () => {
testGateReact19('React Native API assumption: <Modal> renders a single host element', () => {
render(
<Modal testID="test">
<Text>Modal Content</Text>
Expand All @@ -223,9 +226,7 @@ test('React Native API assumption: <Modal> renders a single host element', () =>

expect(screen.toJSON()).toMatchInlineSnapshot(`
<Modal
hardwareAccelerated={false}
testID="test"
visible={true}
>
<Text>
Modal Content
Expand Down
5 changes: 2 additions & 3 deletions src/user-event/__tests__/__snapshots__/clear.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`clear() supports basic case: value: "Hello! 1`] = `
[
Expand Down Expand Up @@ -274,8 +274,7 @@ exports[`clear() supports defaultValue prop: defaultValue: "Hello Default!" 1`]
]
`;

exports[`clear() supports multiline: value: "Hello World!
How are you?" multiline: true, 1`] = `
exports[`clear() supports multiline: value: "Hello World!\\nHow are you?" multiline: true, 1`] = `
[
{
"name": "focus",
Expand Down
5 changes: 2 additions & 3 deletions src/user-event/__tests__/__snapshots__/paste.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`paste() paste on empty text input 1`] = `
[
Expand Down Expand Up @@ -360,8 +360,7 @@ exports[`paste() supports defaultValue prop: defaultValue: "Hello Default!" 1`]
]
`;

exports[`paste() supports multiline: value: "Hello World!
How are you?" multiline: true, 1`] = `
exports[`paste() supports multiline: value: "Hello World!\\nHow are you?" multiline: true, 1`] = `
[
{
"name": "focus",
Expand Down
Loading