Skip to content

Commit 063a59f

Browse files
committed
Cleanup readme, removed prettier config. Applying prettier formatting from root config.
1 parent 41705fe commit 063a59f

File tree

7 files changed

+173
-312
lines changed

7 files changed

+173
-312
lines changed

tools/powersynctests/.prettierrc.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

tools/powersynctests/README.md

Lines changed: 18 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,42 @@
1-
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
1+
# PowerSync Tests
22

3-
# Getting Started
3+
This is a React Native test application for PowerSync, currently only used to test @powersync/op-sqlite.
44

5-
> **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding.
5+
## Getting Started
66

7-
## Step 1: Start Metro
8-
9-
First, you will need to run **Metro**, the JavaScript build tool for React Native.
10-
11-
To start the Metro dev server, run the following command from the root of your React Native project:
7+
1. Install dependencies and build packages in the root directory:
128

139
```sh
14-
# Using npm
15-
npm start
16-
17-
# OR using Yarn
18-
yarn start
10+
pnpm install
11+
pnpm build:packages
1912
```
2013

21-
## Step 2: Build and run your app
22-
23-
With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app:
24-
25-
### Android
14+
2. Start Metro bundler:
2615

2716
```sh
28-
# Using npm
29-
npm run android
30-
31-
# OR using Yarn
32-
yarn android
17+
pnpm start
3318
```
3419

35-
### iOS
20+
3. Run the app:
3621

37-
For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).
22+
### For iOS
3823

39-
The first time you create a new project, run the Ruby bundler to install CocoaPods itself:
24+
Update pods:
4025

4126
```sh
42-
bundle install
27+
cd ios
28+
pod update
29+
cd ..
4330
```
4431

45-
Then, and every time you update your native dependencies, run:
32+
Then run:
4633

4734
```sh
48-
bundle exec pod install
35+
pnpm ios
4936
```
5037

51-
For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html).
38+
### For Android
5239

5340
```sh
54-
# Using npm
55-
npm run ios
56-
57-
# OR using Yarn
58-
yarn ios
41+
pnpm android
5942
```
60-
61-
If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device.
62-
63-
This is one way to run your app — you can also build it directly from Android Studio or Xcode.
64-
65-
## Step 3: Modify your app
66-
67-
Now that you have successfully run the app, let's make changes!
68-
69-
Open `App.tsx` in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes — this is powered by [Fast Refresh](https://reactnative.dev/docs/fast-refresh).
70-
71-
When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload:
72-
73-
- **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Dev Menu**, accessed via <kbd>Ctrl</kbd> + <kbd>M</kbd> (Windows/Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (macOS).
74-
- **iOS**: Press <kbd>R</kbd> in iOS Simulator.
75-
76-
## Congratulations! :tada:
77-
78-
You've successfully run and modified your React Native App. :partying_face:
79-
80-
### Now what?
81-
82-
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
83-
- If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started).
84-
85-
# Troubleshooting
86-
87-
If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
88-
89-
# Learn More
90-
91-
To learn more about React Native, take a look at the following resources:
92-
93-
- [React Native Website](https://reactnative.dev) - learn more about React Native.
94-
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
95-
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
96-
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
97-
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.

tools/powersynctests/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PODS:
88
- hermes-engine (0.78.0):
99
- hermes-engine/Pre-built (= 0.78.0)
1010
- hermes-engine/Pre-built (0.78.0)
11-
- op-sqlite (11.4.8):
11+
- op-sqlite (11.4.9):
1212
- DoubleConversion
1313
- glog
1414
- hermes-engine
@@ -1829,7 +1829,7 @@ SPEC CHECKSUMS:
18291829
fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd
18301830
glog: eb93e2f488219332457c3c4eafd2738ddc7e80b8
18311831
hermes-engine: b417d2b2aee3b89b58e63e23a51e02be91dc876d
1832-
op-sqlite: 060f3d3902e6a49657051505a9c93f2688ef4943
1832+
op-sqlite: d07002ecca5c39575deb7c4abd9e5310da6aa07d
18331833
powersync-op-sqlite: ce90a0e44924deea3901d06892d2d687e6eaf0c1
18341834
powersync-sqlite-core: ef06642c8110680fcddce8a8c0dd2696daaf672d
18351835
RCT-Folly: 36fe2295e44b10d831836cc0d1daec5f8abcf809

tools/powersynctests/src/mocha/MochaRNAdapter.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,14 @@ export const clearTests = () => {
2121
only = false;
2222
};
2323

24-
export const it = (
25-
name: string,
26-
f: MochaTypes.Func | MochaTypes.AsyncFunc,
27-
): void => {
24+
export const it = (name: string, f: MochaTypes.Func | MochaTypes.AsyncFunc): void => {
2825
if (!only) {
2926
const test = new Mocha.Test(name, f);
3027
suite.addTest(test);
3128
}
3229
};
3330

34-
export const itOnly = (
35-
name: string,
36-
f: MochaTypes.Func | MochaTypes.AsyncFunc,
37-
): void => {
31+
export const itOnly = (name: string, f: MochaTypes.Func | MochaTypes.AsyncFunc): void => {
3832
clearTests();
3933
const test = new Mocha.Test(name, f);
4034
suite.addTest(test);

tools/powersynctests/src/mocha/MochaSetup.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
import 'mocha';
66
import type * as MochaTypes from 'mocha';
7-
import {clearTests, rootSuite} from './MochaRNAdapter';
7+
import { clearTests, rootSuite } from './MochaRNAdapter';
88

99
export type TestResult = {
1010
description: string;
@@ -14,13 +14,13 @@ export type TestResult = {
1414
};
1515

1616
export async function runTests(...registrators: Array<() => void>) {
17-
const promise = new Promise<TestResult[]>(resolve => {
17+
const promise = new Promise<TestResult[]>((resolve) => {
1818
const {
1919
EVENT_RUN_BEGIN,
2020
EVENT_RUN_END,
2121
EVENT_TEST_FAIL,
2222
EVENT_TEST_PASS,
23-
EVENT_SUITE_BEGIN,
23+
EVENT_SUITE_BEGIN
2424
// EVENT_SUITE_END,
2525
} = Mocha.Runner.constants;
2626

@@ -36,30 +36,30 @@ export async function runTests(...registrators: Array<() => void>) {
3636
results.push({
3737
description: name,
3838
key: Math.random().toString(),
39-
type: 'grouping',
39+
type: 'grouping'
4040
});
4141
}
4242
})
4343
.on(EVENT_TEST_PASS, (test: MochaTypes.Runnable) => {
4444
results.push({
4545
description: test.title,
4646
key: Math.random().toString(),
47-
type: 'correct',
47+
type: 'correct'
4848
});
4949
})
5050
.on(EVENT_TEST_FAIL, (test: MochaTypes.Runnable, err: Error) => {
5151
results.push({
5252
description: test.title,
5353
key: Math.random().toString(),
5454
type: 'incorrect',
55-
errorMsg: err.message,
55+
errorMsg: err.message
5656
});
5757
})
5858
.once(EVENT_RUN_END, () => {
5959
resolve(results);
6060
});
6161

62-
registrators.forEach(register => {
62+
registrators.forEach((register) => {
6363
register();
6464
});
6565

@@ -85,17 +85,14 @@ function cloneSuite(suite: MochaTypes.Suite) {
8585
/**
8686
* Run a child of the root suite. This effectively runs a single test suite.
8787
*/
88-
export async function runFiltered(
89-
suite: MochaTypes.Suite,
90-
test?: MochaTypes.Test,
91-
) {
92-
const promise = new Promise<TestResult[]>(resolve => {
88+
export async function runFiltered(suite: MochaTypes.Suite, test?: MochaTypes.Test) {
89+
const promise = new Promise<TestResult[]>((resolve) => {
9390
const {
9491
EVENT_RUN_BEGIN,
9592
EVENT_RUN_END,
9693
EVENT_TEST_FAIL,
9794
EVENT_TEST_PASS,
98-
EVENT_SUITE_BEGIN,
95+
EVENT_SUITE_BEGIN
9996
// EVENT_SUITE_END,
10097
} = Mocha.Runner.constants;
10198

@@ -130,23 +127,23 @@ export async function runFiltered(
130127
results.push({
131128
description: name,
132129
key: Math.random().toString(),
133-
type: 'grouping',
130+
type: 'grouping'
134131
});
135132
}
136133
})
137134
.on(EVENT_TEST_PASS, (test: MochaTypes.Runnable) => {
138135
results.push({
139136
description: test.title,
140137
key: Math.random().toString(),
141-
type: 'correct',
138+
type: 'correct'
142139
});
143140
})
144141
.on(EVENT_TEST_FAIL, (test: MochaTypes.Runnable, err: Error) => {
145142
results.push({
146143
description: test.title,
147144
key: Math.random().toString(),
148145
type: 'incorrect',
149-
errorMsg: err.message,
146+
errorMsg: err.message
150147
});
151148
})
152149
.once(EVENT_RUN_END, () => {

0 commit comments

Comments
 (0)