Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: reformat imports #1742

Merged
merged 1 commit into from
Jan 29, 2025
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
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default [
'simple-import-sort/imports': [
'error',
{
groups: [['^\\u0000', '^react', '^@?\\w', '^', '^\\.']],
groups: [['^\\u0000', '^react', '^@?\\w', '^'], ['^\\.']],
},
],
},
Expand Down
3 changes: 2 additions & 1 deletion src/__tests__/act.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import { Text } from 'react-native';
import { act, fireEvent, render, screen } from '../';

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

type UseEffectProps = { callback(): void };
const UseEffect = ({ callback }: UseEffectProps) => {
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/auto-cleanup.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { View } from 'react-native';

import { render } from '..';

let isMounted = false;
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/cleanup.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { View } from 'react-native';

import { cleanup, render } from '../pure';

class Test extends React.Component<{ onUnmount: () => void }> {
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/fire-event-textInput.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import type { TextInputProps } from 'react-native';
import { Text, TextInput } from 'react-native';

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

function WrappedTextInput(props: TextInputProps) {
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/fire-event.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
TouchableOpacity,
View,
} from 'react-native';

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

type OnPressComponentProps = {
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/host-component-names.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Image, Modal, ScrollView, Switch, Text, TextInput } from 'react-native';

import { render, screen } from '..';
import {
isHostImage,
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/host-text-nesting.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Pressable, Text, View } from 'react-native';

import { render, screen, within } from '../pure';

/**
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/questionsBoard.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Pressable, ScrollView, Text, TextInput, View } from 'react-native';

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

type QuestionsBoardProps = {
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/react-native-animated.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import type { ViewStyle } from 'react-native';
import { Animated } from 'react-native';

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

type AnimatedViewProps = {
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/react-native-api.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { FlatList, Image, Modal, ScrollView, Switch, Text, TextInput, View } from 'react-native';

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

/**
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/render-debug.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Pressable, Text, TextInput, View } from 'react-native';

import { configure, fireEvent, render, screen } from '..';
import { logger } from '../helpers/logger';

Expand Down
1 change: 1 addition & 0 deletions src/__tests__/render-hook.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ReactNode } from 'react';
import React from 'react';
import TestRenderer from 'react-test-renderer';

import { renderHook } from '../pure';

test('gives committed result', () => {
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/render-string-validation.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Pressable, Text, View } from 'react-native';

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

// eslint-disable-next-line no-console
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/render.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Pressable, Text, TextInput, View } from 'react-native';

import type { RenderAPI } from '..';
import { fireEvent, render, screen } from '..';

Expand Down
1 change: 1 addition & 0 deletions src/__tests__/screen.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Text, View } from 'react-native';

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

test('screen has the same queries as render result', () => {
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/wait-for-element-to-be-removed.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from 'react';
import { Text, TouchableOpacity, View } from 'react-native';

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

const TestSetup = ({ shouldUseDelay = true }) => {
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/wait-for.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Pressable, Text, TouchableOpacity, View } from 'react-native';

import { configure, fireEvent, render, screen, waitFor } from '..';

class Banana extends React.Component<any> {
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/within.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Text, TextInput, View } from 'react-native';

import { getQueriesForElement, render, within } from '..';

test('within() exposes basic queries', async () => {
Expand Down
1 change: 1 addition & 0 deletions src/fire-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {
ViewProps,
} from 'react-native';
import type { ReactTestInstance } from 'react-test-renderer';

import act from './act';
import { isElementMounted, isHostElement } from './helpers/component-tree';
import { isHostScrollView, isHostTextInput } from './helpers/host-component-names';
Expand Down
1 change: 1 addition & 0 deletions src/helpers/__tests__/accessiblity.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { Pressable, Switch, Text, TextInput, TouchableOpacity, View } from 'react-native';

import { isHiddenFromAccessibility, isInaccessible, render, screen } from '../..';
import { computeAriaLabel, isAccessibilityElement } from '../accessibility';

Expand Down
1 change: 1 addition & 0 deletions src/helpers/__tests__/component-tree.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { Text, TextInput, View } from 'react-native';

import { render, screen } from '../..';
import {
getHostChildren,
Expand Down
1 change: 1 addition & 0 deletions src/helpers/__tests__/format-element.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Text, View } from 'react-native';

import { render, screen } from '../..';
import { formatElement } from '../format-element';

Expand Down
1 change: 1 addition & 0 deletions src/helpers/__tests__/include-hidden-elements.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { View } from 'react-native';

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

test('includeHiddenElements query option takes priority over hidden option and global config', () => {
Expand Down
3 changes: 2 additions & 1 deletion src/helpers/__tests__/text-content.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import { Text } from 'react-native';
import { render, screen } from '../../';

import { render, screen } from '../..';
import { getTextContent } from '../text-content';

test('getTextContent with simple content', () => {
Expand Down
1 change: 1 addition & 0 deletions src/helpers/__tests__/text-input.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { TextInput, View } from 'react-native';

import { render, screen } from '../..';
import { getTextInputValue, isEditableTextInput } from '../text-input';

Expand Down
1 change: 1 addition & 0 deletions src/helpers/accessibility.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { AccessibilityRole, AccessibilityState, AccessibilityValue, Role } from 'react-native';
import { StyleSheet } from 'react-native';
import type { ReactTestInstance } from 'react-test-renderer';

import { getHostSiblings, getUnsafeRootElement, isHostElement } from './component-tree';
import { findAll } from './find-all';
import { isHostImage, isHostSwitch, isHostText, isHostTextInput } from './host-component-names';
Expand Down
1 change: 1 addition & 0 deletions src/helpers/component-tree.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ReactTestInstance } from 'react-test-renderer';

import { screen } from '../screen';
/**
* ReactTestInstance referring to host element.
Expand Down
1 change: 1 addition & 0 deletions src/helpers/debug.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ReactTestRendererJSON } from 'react-test-renderer';

import type { FormatElementOptions } from './format-element';
import { formatJson } from './format-element';
import { logger } from './logger';
Expand Down
1 change: 1 addition & 0 deletions src/helpers/find-all.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ReactTestInstance } from 'react-test-renderer';

import { getConfig } from '../config';
import { isHiddenFromAccessibility } from './accessibility';
import type { HostTestInstance } from './component-tree';
Expand Down
1 change: 1 addition & 0 deletions src/helpers/format-element.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ReactTestInstance, ReactTestRendererJSON } from 'react-test-renderer';
import type { NewPlugin } from 'pretty-format';
import prettyFormat, { plugins } from 'pretty-format';

import type { MapPropsFunction } from './map-props';
import { defaultMapProps } from './map-props';

Expand Down
1 change: 1 addition & 0 deletions src/helpers/host-component-names.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ReactTestInstance } from 'react-test-renderer';

import type { HostTestInstance } from './component-tree';

const HOST_TEXT_NAMES = ['Text', 'RCTText'];
Expand Down
1 change: 1 addition & 0 deletions src/helpers/map-props.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ViewStyle } from 'react-native';
import { StyleSheet } from 'react-native';

import { removeUndefinedKeys } from './object';

export type MapPropsFunction = (props: Record<string, unknown>) => Record<string, unknown>;
Expand Down
1 change: 1 addition & 0 deletions src/helpers/matchers/match-accessibility-state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ReactTestInstance } from 'react-test-renderer';

import {
computeAriaBusy,
computeAriaChecked,
Expand Down
1 change: 1 addition & 0 deletions src/helpers/matchers/match-accessibility-value.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ReactTestInstance } from 'react-test-renderer';

import type { TextMatch } from '../../matches';
import { computeAriaValue } from '../accessibility';
import { matchStringProp } from './match-string-prop';
Expand Down
1 change: 1 addition & 0 deletions src/helpers/matchers/match-label-text.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ReactTestInstance } from 'react-test-renderer';

import type { TextMatch, TextMatchOptions } from '../../matches';
import { matches } from '../../matches';
import { computeAriaLabel } from '../accessibility';
Expand Down
1 change: 1 addition & 0 deletions src/helpers/matchers/match-text-content.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ReactTestInstance } from 'react-test-renderer';

import type { TextMatch, TextMatchOptions } from '../../matches';
import { matches } from '../../matches';
import { getTextContent } from '../text-content';
Expand Down
1 change: 1 addition & 0 deletions src/helpers/pointer-events.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ReactTestInstance } from 'react-test-renderer';

import { getHostParent } from './component-tree';

/**
Expand Down
1 change: 1 addition & 0 deletions src/helpers/text-input.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ReactTestInstance } from 'react-test-renderer';

import { nativeState } from '../native-state';
import { isHostTextInput } from './host-component-names';

Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import './matchers/extend-expect';

import { getIsReactActEnvironment, setReactActEnvironment } from './act';
import { flushMicroTasks } from './flush-micro-tasks';
import { cleanup } from './pure';
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-be-busy.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { View } from 'react-native';

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

test('toBeBusy() basic case', () => {
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-be-checked.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { type AccessibilityRole, Switch, View } from 'react-native';

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

function renderViewsWithRole(role: AccessibilityRole) {
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-be-disabled.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
TouchableWithoutFeedback,
View,
} from 'react-native';

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

test('toBeDisabled()/toBeEnabled() supports basic case', () => {
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-be-empty-element.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { View } from 'react-native';

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

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-be-expanded.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { View } from 'react-native';

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

test('toBeExpanded() basic case', () => {
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-be-on-the-screen.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Text, View } from 'react-native';

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

test('toBeOnTheScreen() example test', () => {
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-be-partially-checked.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { type AccessibilityRole, View } from 'react-native';

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

function renderViewsWithRole(role: AccessibilityRole) {
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-be-selected.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { View } from 'react-native';

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

test('toBeSelected() basic case', () => {
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-be-visible.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Modal, View } from 'react-native';

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

test('toBeVisible() on empty view', () => {
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-contain-element.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { View } from 'react-native';

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

test('toContainElement() supports basic case', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { View } from 'react-native';

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

describe('toHaveAccessibilityValue', () => {
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-have-accessible-name.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Image, Text, TextInput, View } from 'react-native';

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

test('toHaveAccessibleName() handles view with "accessibilityLabel" prop', () => {
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-have-display-value.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { TextInput, View } from 'react-native';

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

test('toHaveDisplayValue() example test', () => {
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-have-prop.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { Text, TextInput, View } from 'react-native';

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

test('toHaveProp() basic case', () => {
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-have-style.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { Pressable, StyleSheet, View } from 'react-native';

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

const styles = StyleSheet.create({
Expand Down
1 change: 1 addition & 0 deletions src/matchers/__tests__/to-have-text-content.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { Text, View } from 'react-native';

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

test('toHaveTextContent() example test', () => {
Expand Down
Loading