Skip to content

Commit c2b699a

Browse files
gabrieldonadelfacebook-github-bot
authored andcommitted
chore: Fix RNTester typos (#34757)
Summary: While working on #34550 I noticed that a couple of words inside the RNTester package were misspelled, this gave me the idea to test other files as well using the VS Code extension [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) which unveiled quite a few other typos. ## Changelog [Internal] [Fixed] - Fix RNTester typos Pull Request resolved: #34757 Test Plan: Shouldn't require much testing as this is just fixing some typos inside the RNTester package. Reviewed By: dmytrorykun Differential Revision: D39722889 Pulled By: cortinico fbshipit-source-id: a575ab8337586c5fe2d68ce73d2aae27d24a6384
1 parent 41c6c69 commit c2b699a

File tree

14 files changed

+31
-30
lines changed

14 files changed

+31
-30
lines changed

packages/rn-tester/js/examples/Alert/AlertExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export default ({
309309
category: 'UI',
310310
documentationURL: 'https://reactnative.dev/docs/alert',
311311
description:
312-
'Alerts display a concise and informative messageand prompt the user to make a decision.',
312+
'Alerts display a concise and informative message and prompt the user to make a decision.',
313313
showIndividualExamples: true,
314314
examples,
315315
}: RNTesterModule);

packages/rn-tester/js/examples/Experimental/PlatformTest/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ function ExampleTestCase ({ harness }) { /* ... */ }
2222
```
2323

2424

25-
As of writting this README there are 2 different types of tests that the `harness` prop provides:
25+
As of writing this README there are 2 different types of tests that the `harness` prop provides:
2626

2727
### `test(testcase: (TestContext) => void, testName: string, options?: TestOptions)`
2828

29-
This is a method to create "regular" test reminicent of other frameworks such as Jest. These are meant to be run imperatively, and while that means that they technically could work in a `useEffect` hook as a way to run the test "on mount" — it is instead recommended to try and keep these tests in callbacks instead. A good alternative to running the test on mount would be to instead put the test in a callback and render a "Start Test" button which executes the callback.
29+
This is a method to create "regular" test reminiscent of other frameworks such as Jest. These are meant to be run imperatively, and while that means that they technically could work in a `useEffect` hook as a way to run the test "on mount" — it is instead recommended to try and keep these tests in callbacks instead. A good alternative to running the test on mount would be to instead put the test in a callback and render a "Start Test" button which executes the callback.
3030

3131
The first argument is the closure in which you will run your test and make assertions. The assertions are contained in the `TestContext` object which is provided in the test closure's first argument and contains the following assertions:
3232

@@ -88,7 +88,7 @@ Here's what a basic example would look like for verifying that `pointermove` eve
8888

8989
```js
9090
function BasicPointerMoveTestCase({harness}) {
91-
const testPointerMove = harness.useAsyncTest('pointermove event recieved');
91+
const testPointerMove = harness.useAsyncTest('pointermove event received');
9292

9393
return (
9494
<View

packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class RNTesterPlatformTestEventRecorder {
3030
allRecords: Array<EventRecord> = [];
3131
relevantEvents: Array<string> = [];
3232
rawOrder: number = 1;
33-
eventsInScope: Array<EventRecord> = []; // Tracks syncronous event dispatches
33+
eventsInScope: Array<EventRecord> = []; // Tracks synchronous event dispatches
3434
recording: boolean = true;
3535

3636
mergeTypesTruthMap: {[string]: boolean} = {};

packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function FilterModalButton(props: FilterModalProps) {
8282
transparent={true}>
8383
<SafeAreaView style={styles.filterModalRoot}>
8484
<KeyboardAvoidingView
85-
style={styles.filterModalKeboardAvoidingRoot}
85+
style={styles.filterModalKeyboardAvoidingRoot}
8686
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}>
8787
<View style={styles.filterModalContainer}>
8888
<View style={styles.filterModalContentContainer}>
@@ -373,7 +373,7 @@ const styles = StyleSheet.create({
373373
borderColor: 'rgb(171, 171, 171)',
374374
borderRadius: 8,
375375
},
376-
filterModalKeboardAvoidingRoot: {
376+
filterModalKeyboardAvoidingRoot: {
377377
flex: 1,
378378
alignItems: 'center',
379379
justifyContent: 'center',

packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export type PlatformTestResult = $ReadOnly<{|
3434
name: string,
3535
status: PlatformTestResultStatus,
3636
assertions: $ReadOnlyArray<PlatformTestAssertionResult>,
37-
error: mixed | null, // null is technically unecessary but is kept to ensure the error is described as nullable
37+
error: mixed | null, // null is technically unnecessary but is kept to ensure the error is described as nullable
3838
|}>;
3939

4040
export type PlatformTestContext = $ReadOnly<{

packages/rn-tester/js/examples/Experimental/PlatformTest/usePlatformTestHarness.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export default function usePlatformTestHarness(): PlatformTestHarnessHookResult
144144
$ReadOnlyArray<PlatformTestResult>,
145145
>([]);
146146

147-
// Since updaing the test results array can get expensive at larger sizes
147+
// Since updating the test results array can get expensive at larger sizes
148148
// we use a basic debouncing logic to minimize the number of re-renders
149149
// caused by adding test results
150150
const resultQueueRef = useRef<Array<PlatformTestResult>>([]);
@@ -174,7 +174,7 @@ export default function usePlatformTestHarness(): PlatformTestHarnessHookResult
174174
[scheduleResultsCommit],
175175
);
176176

177-
// When reseting the test results we should also re-mount the
177+
// When resetting the test results we should also re-mount the
178178
// so we apply a key to that component which we can increment
179179
// to ensure it re-mounts
180180
const [testElementKey, setTestElementKey] = useState<number>(0);
@@ -220,7 +220,7 @@ export default function usePlatformTestHarness(): PlatformTestHarnessHookResult
220220
'assert_true',
221221
cond,
222222
desc,
223-
"expected 'true' but recieved 'false'",
223+
"expected 'true' but received 'false'",
224224
),
225225
assert_equals: (a: any, b: any, desc: string) =>
226226
baseAssert(

packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPointerMove.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @flow
99
*/
1010

11-
// adapated from https://github.com/web-platform-tests/wpt/blob/master/pointerevents/pointerevent_pointermove.html
11+
// adapted from https://github.com/web-platform-tests/wpt/blob/master/pointerevents/pointerevent_pointermove.html
1212

1313
import type {PlatformTestComponentBaseProps} from '../PlatformTest/RNTesterPlatformTestTypes';
1414
import type {PointerEvent} from 'react-native/Libraries/Types/CoreEventTypes';
@@ -25,7 +25,7 @@ function PointerEventPointerMoveTestCase(
2525
const {harness} = props;
2626

2727
const detectedPointerTypesRef = useRef({});
28-
const testPointerMove = harness.useAsyncTest('pointermove event recieved');
28+
const testPointerMove = harness.useAsyncTest('pointermove event received');
2929

3030
const handlers = useTestEventHandler(
3131
['pointerMove'],

packages/rn-tester/js/examples/FlatList/BaseFlatListExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ const styles = StyleSheet.create({
144144
separator: {
145145
height: 12,
146146
},
147-
separtorText: {
147+
separatorText: {
148148
fontSize: 10,
149149
},
150150
list: {

packages/rn-tester/js/examples/FlatList/FlatList-withSeparators.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const Separator =
3232
styles.separator,
3333
{backgroundColor: highlighted ? highlightColor : defaultColor},
3434
]}>
35-
<Text style={styles.separtorText}>{text}</Text>
35+
<Text style={styles.separatorText}>{text}</Text>
3636
</View>
3737
);
3838
};
@@ -50,7 +50,7 @@ const styles = StyleSheet.create({
5050
separator: {
5151
height: 12,
5252
},
53-
separtorText: {
53+
separatorText: {
5454
fontSize: 10,
5555
},
5656
});

packages/rn-tester/js/examples/Keyboard/KeyboardExample.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ import * as React from 'react';
2020
import {useEffect, useState} from 'react';
2121
import {Keyboard, StyleSheet, Text, View} from 'react-native';
2222

23-
type KeybpardEventViewerProps = {
23+
type KeyboardEventViewerProps = {
2424
showEvent: 'keyboardWillShow' | 'keyboardDidShow',
2525
hideEvent: 'keyboardWillHide' | 'keyboardDidHide',
2626
};
2727

28-
const KeyboardEventViewer = (props: KeybpardEventViewerProps): React.Node => {
28+
const KeyboardEventViewer = (props: KeyboardEventViewerProps): React.Node => {
2929
const {showEvent, hideEvent} = props;
3030
const [isShown, setIsShown] = useState(false);
3131
const [lastEvent, setLastEvent] = useState<?KeyboardEvent>();

0 commit comments

Comments
 (0)