Skip to content

Commit

Permalink
docs: tweaks (#524)
Browse files Browse the repository at this point in the history
* docs: tweaks

* chore: sync readme
  • Loading branch information
mdjastrzebski committed Aug 28, 2024
1 parent 018cd40 commit f26ca41
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 40 deletions.
25 changes: 6 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
- [Measuring test performance](#measuring-test-performance)
- [Write performance testing script](#write-performance-testing-script)
- [CI setup](#ci-setup)
- [Options](#options)
- [`--verbose` (optional)](#--verbose-optional)
- [`--silent` (optional)](#--silent-optional)
- [Scaffolding](#scaffolding)
- [CI Script (`reassure-tests.sh`)](#ci-script-reassure-testssh)
- [Dangerfile](#dangerfile)
Expand All @@ -49,7 +46,7 @@
- [Configuration](#configuration)
- [Default configuration](#default-configuration)
- [`configure` function](#configure-function)
- [`resetToDefault` function](#resettodefault-function)
- [`resetToDefaults` function](#resettodefaults-function)
- [Environmental variables](#environmental-variables)
- [External References](#external-references)
- [Contributing](#contributing)
Expand Down Expand Up @@ -88,6 +85,8 @@ npm install --save-dev reassure

You will also need a working [Jest](https://jestjs.io/docs/getting-started) setup as well as one of either [React Native Testing Library](https://github.com/callstack/react-native-testing-library#installation) or [React Testing Library](https://testing-library.com/docs/react-testing-library/intro).

See [Installation guide](https://callstack.github.io/reassure/docs/installation).

You can check our example projects:

- [React Native (Expo)](https://github.com/callstack/reassure-examples/tree/main/examples/native-expo)
Expand Down Expand Up @@ -121,7 +120,7 @@ test('Simple test', async () => {

This test will measure render times of `ComponentUnderTest` during mounting and resulting sync effects.

> **Note**: Reassure will automatically match test filenames using Jest's `--testMatch` option with value `"<rootDir>/**/*.perf-test.[jt]s?(x)"`. However, if you want to pass a custom `--testMatch` option, you may add it to the `reassure measure` script to pass your own glob. More about `--testMatch` in [Jest docs](https://jestjs.io/docs/configuration#testmatch-arraystring)
> **Note**: Reassure will automatically match test filenames using Jest's `--testMatch` option with value `"**/__perf__/**/*.[jt]s?(x)", "**/*.(perf|perf-test).[jt]s?(x)"`. However, if you want to pass a custom `--testMatch` or `--testRegex` option, you may add it to the `reassure measure` script to pass your own glob. More about `--testMatch` and `--testRegex` in [Jest docs](https://jestjs.io/docs/configuration#testmatch-arraystring)
#### Writing async tests

Expand Down Expand Up @@ -227,18 +226,6 @@ This will generate the following file structure
│ └── .gitignore
```

### Options

You can also use the following options to adjust the script further

#### `--verbose` (optional)

This is one of the options controlling the level of logs printed into the command prompt while running reassure scripts. It will

#### `--silent` (optional)

Just like the previous, this option also controls the level of logs. It will suppress all logs besides explicit errors.

### Scaffolding

#### CI Script (`reassure-tests.sh`)
Expand Down Expand Up @@ -474,7 +461,7 @@ Reset the current config to the original `defaultConfig` object
You can use available environmental variables to alter your test runner settings.

- `TEST_RUNNER_PATH`: an alternative path for your test runner. Defaults to `'node_modules/.bin/jest'` or on Windows `'node_modules/jest/bin/jest'`
- `TEST_RUNNER_ARGS`: a set of arguments fed to the runner. Defaults to `'--runInBand --testMatch "<rootDir>/**/*.perf-test.[jt]s?(x)"'`
- `TEST_RUNNER_ARGS`: a set of arguments fed to the runner. Defaults to `'--runInBand --testMatch "**/__perf__/**/*.[jt]s?(x)", "**/*.(perf|perf-test).[jt]s?(x)"'`

Example:

Expand All @@ -484,7 +471,7 @@ TEST_RUNNER_PATH=myOwnPath/jest/bin yarn reassure

## External References

- [The Ultimate Guide to React Native Optimization 2023 Edition](https://www.callstack.com/campaigns/download-the-ultimate-guide-to-react-native-optimization?utm_campaign=RN_Performance&utm_source=readme_reassure) - Mentioned in "Make your app consistently fast" chapter.
- [The Ultimate Guide to React Native Optimization 2024 Edition](https://www.callstack.com/campaigns/download-the-ultimate-guide-to-react-native-optimization?utm_campaign=RN_Performance&utm_source=readme_reassure) - Mentioned in "Make your app consistently fast" chapter.

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Reset current config to the original `defaultConfig` object. You can call `reset
The `reassure` CLI can be parametrized using available environmental variables:
- `TEST_RUNNER_PATH`: an alternative path for your test runner. Defaults to `'node_modules/.bin/jest'` or on Windows `'node_modules/jest/bin/jest'`
- `TEST_RUNNER_ARGS`: a set of arguments fed to the runner. Defaults to `'--runInBand --testMatch "<rootDir>/**/*.perf-test.[jt]s?(x)"'`
- `TEST_RUNNER_ARGS`: a set of arguments fed to the runner. Defaults to `'--runInBand --testMatch "**/__perf__/**/*.[jt]s?(x)", "**/*.(perf|perf-test).[jt]s?(x)"`

Example:

Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/migration-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The signature of the function did not change. Old name is no longer available.

## Testing environment

Reassure v0 used Node.js JIT-less mode (`--jitless` node flag), optionally using different flags if `--enable-wasp` experimental option was passed. Reassure V1 runs tests using Node.js's non-optimized compilation to better reflect React Native runtime environment.
Reassure v0 used Node.js JIT-less mode (`--jitless` node flag), optionally using different flags if `--enable-wasm` experimental option was passed. Reassure V1 runs tests using Node.js's non-optimized compilation to better reflect React Native runtime environment.

This means that:

Expand Down
25 changes: 6 additions & 19 deletions packages/reassure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
- [Measuring test performance](#measuring-test-performance)
- [Write performance testing script](#write-performance-testing-script)
- [CI setup](#ci-setup)
- [Options](#options)
- [`--verbose` (optional)](#--verbose-optional)
- [`--silent` (optional)](#--silent-optional)
- [Scaffolding](#scaffolding)
- [CI Script (`reassure-tests.sh`)](#ci-script-reassure-testssh)
- [Dangerfile](#dangerfile)
Expand All @@ -49,7 +46,7 @@
- [Configuration](#configuration)
- [Default configuration](#default-configuration)
- [`configure` function](#configure-function)
- [`resetToDefault` function](#resettodefault-function)
- [`resetToDefaults` function](#resettodefaults-function)
- [Environmental variables](#environmental-variables)
- [External References](#external-references)
- [Contributing](#contributing)
Expand Down Expand Up @@ -88,6 +85,8 @@ npm install --save-dev reassure

You will also need a working [Jest](https://jestjs.io/docs/getting-started) setup as well as one of either [React Native Testing Library](https://github.com/callstack/react-native-testing-library#installation) or [React Testing Library](https://testing-library.com/docs/react-testing-library/intro).

See [Installation guide](https://callstack.github.io/reassure/docs/installation).

You can check our example projects:

- [React Native (Expo)](https://github.com/callstack/reassure-examples/tree/main/examples/native-expo)
Expand Down Expand Up @@ -121,7 +120,7 @@ test('Simple test', async () => {

This test will measure render times of `ComponentUnderTest` during mounting and resulting sync effects.

> **Note**: Reassure will automatically match test filenames using Jest's `--testMatch` option with value `"<rootDir>/**/*.perf-test.[jt]s?(x)"`. However, if you want to pass a custom `--testMatch` option, you may add it to the `reassure measure` script to pass your own glob. More about `--testMatch` in [Jest docs](https://jestjs.io/docs/configuration#testmatch-arraystring)
> **Note**: Reassure will automatically match test filenames using Jest's `--testMatch` option with value `"**/__perf__/**/*.[jt]s?(x)", "**/*.(perf|perf-test).[jt]s?(x)"`. However, if you want to pass a custom `--testMatch` or `--testRegex` option, you may add it to the `reassure measure` script to pass your own glob. More about `--testMatch` and `--testRegex` in [Jest docs](https://jestjs.io/docs/configuration#testmatch-arraystring)
#### Writing async tests

Expand Down Expand Up @@ -227,18 +226,6 @@ This will generate the following file structure
│ └── .gitignore
```

### Options

You can also use the following options to adjust the script further

#### `--verbose` (optional)

This is one of the options controlling the level of logs printed into the command prompt while running reassure scripts. It will

#### `--silent` (optional)

Just like the previous, this option also controls the level of logs. It will suppress all logs besides explicit errors.

### Scaffolding

#### CI Script (`reassure-tests.sh`)
Expand Down Expand Up @@ -474,7 +461,7 @@ Reset the current config to the original `defaultConfig` object
You can use available environmental variables to alter your test runner settings.

- `TEST_RUNNER_PATH`: an alternative path for your test runner. Defaults to `'node_modules/.bin/jest'` or on Windows `'node_modules/jest/bin/jest'`
- `TEST_RUNNER_ARGS`: a set of arguments fed to the runner. Defaults to `'--runInBand --testMatch "<rootDir>/**/*.perf-test.[jt]s?(x)"'`
- `TEST_RUNNER_ARGS`: a set of arguments fed to the runner. Defaults to `'--runInBand --testMatch "**/__perf__/**/*.[jt]s?(x)", "**/*.(perf|perf-test).[jt]s?(x)"'`

Example:

Expand All @@ -484,7 +471,7 @@ TEST_RUNNER_PATH=myOwnPath/jest/bin yarn reassure

## External References

- [The Ultimate Guide to React Native Optimization 2023 Edition](https://www.callstack.com/campaigns/download-the-ultimate-guide-to-react-native-optimization?utm_campaign=RN_Performance&utm_source=readme_reassure) - Mentioned in "Make your app consistently fast" chapter.
- [The Ultimate Guide to React Native Optimization 2024 Edition](https://www.callstack.com/campaigns/download-the-ultimate-guide-to-react-native-optimization?utm_campaign=RN_Performance&utm_source=readme_reassure) - Mentioned in "Make your app consistently fast" chapter.

## Contributing

Expand Down

0 comments on commit f26ca41

Please sign in to comment.