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

Introduce file structure to tests #6293

Merged
merged 8 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
File structure
  • Loading branch information
Latropos committed Jul 18, 2024
commit aa1959af9e6a4fbae1b5ef139339452956a2dcae
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Component, ReactElement } from 'react';
import { TestRunner } from './TestRunner';
import { TestRunner } from './TestRunner/TestRunner';
import type { TestComponent } from './TestComponent';
import type { SharedValue } from 'react-native-reanimated';
import type { TestConfiguration, TestValue, NullableTestValue, BuildFunction } from './types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { View, StyleSheet, Text, Pressable } from 'react-native';
import type { ReactNode } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import { runTests, configure } from './RuntimeTestsApi';
import { RenderLock } from './SyncUIRunner';
import { RenderLock } from './utils/SyncUIRunner';

export class ErrorBoundary extends React.Component<
{ children: React.JSX.Element | Array<React.JSX.Element> },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TestCase, TestSuite } from './types';
import type { TestCase, TestSuite } from '../types';

export function assertMockedAnimationTimestamp(timestamp: number | undefined): asserts timestamp is number {
'worklet';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,29 @@ import type {
TestSummary,
TestValue,
TrackerCallCount,
} from './types';
import { DescribeDecorator, TestDecorator } from './types';
import { TestComponent } from './TestComponent';
import { EMPTY_LOG_PLACEHOLDER, applyMarkdown, color, formatString, indentNestingLevel } from './stringFormatUtils';
} from '../types';
import { DescribeDecorator, TestDecorator } from '../types';
import { TestComponent } from '../TestComponent';
import {
EMPTY_LOG_PLACEHOLDER,
applyMarkdown,
color,
formatString,
indentNestingLevel,
} from '../utils/stringFormatUtils';
import type {
SharedValue,
LayoutAnimationStartFunction,
LayoutAnimationType,
SharedTransitionAnimationsValues,
LayoutAnimation,
} from 'react-native-reanimated';
import { Matchers, nullableMatch } from './matchers/Matchers';
import { Matchers, nullableMatch } from '../matchers/Matchers';
import { assertMockedAnimationTimestamp, assertTestCase, assertTestSuite } from './Asserts';
import { createUpdatesContainer } from './UpdatesContainer';
import { makeMutable, runOnJS } from 'react-native-reanimated';
import { RenderLock, SyncUIRunner } from './SyncUIRunner';
export { Presets } from './Presets';
import { RenderLock, SyncUIRunner } from '../utils/SyncUIRunner';
export { Presets } from '../Presets';

let callTrackerRegistryJS: Record<string, number> = {};
const callTrackerRegistryUI = makeMutable<Record<string, number>>({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { isValidPropName } from './types';
import type { MultiViewSnapshot, SingleViewSnapshot } from './matchers/snapshotMatchers';
import { convertDecimalColor } from './util';
import type { TestComponent } from './TestComponent';
import { SyncUIRunner } from './SyncUIRunner';
import { SyncUIRunner } from './utils/SyncUIRunner';

type JsUpdate = {
tag: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { color } from '../stringFormatUtils';
import { color } from '../utils/stringFormatUtils';
import type { TestCase, TestValue, NullableTestValue } from '../types';
import type { Matcher, MatcherArguments } from './rawMatchers';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cyan, green, red, yellow } from '../stringFormatUtils';
import { cyan, green, red, yellow } from '../utils/stringFormatUtils';
import type { TestValue, TrackerCallCount } from '../types';
import { ComparisonMode } from '../types';
import { getComparator } from './Comparators';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { formatSnapshotMismatch, green, red, yellow } from '../stringFormatUtils';
import { formatSnapshotMismatch, green, red, yellow } from '../utils/stringFormatUtils';
import type { OperationUpdate, Mismatch } from '../types';
import { ComparisonMode, isValidPropName } from '../types';
import { getComparator, getComparisonModeForProp } from './Comparators';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { runOnJS, runOnUI } from 'react-native-reanimated';
import type { LockObject } from './types';
import type { LockObject } from '../types';

class WaitForUnlock {
private _lock: LockObject = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Mismatch, NullableTestValue } from './types';
import type { Mismatch, NullableTestValue } from '../types';

export function indentNestingLevel(nestingLevel: number) {
return ` ${' '.repeat(nestingLevel)}`;
Expand Down
Loading