Skip to content

Commit

Permalink
Revert README.md changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseLion committed Jun 30, 2024
1 parent 3b587ba commit 86e2277
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,36 +72,9 @@ import "react-native-testing-mocks/register";
// ...rest of your setup code
```

### Usage with Vite
### Mocha.js Example

Even though Vite could be in charge of transforming/resolving the React Native files, this library already does that under the hood with Babel. This is not ideal on Vite, but it does work with the right setup. Here's a minimal example of what your `vitest.config.ts` should look like:

```ts
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
globals: true,
include: ["test/**/*.test.ts?(x)"],
server: {
deps: {
external: [
"react-native",
"@react-native",
],
},
},
setupFiles: [
import.meta.resolve("react-native-testing-mocks/register"),
// ...any other setup files
],
},
});
```

### Usage with Mocha

Some frameworks provide mechanisms to load setup modules. In Mocha.js, you can use the `--require` CLI option:
Some frameworks also provide mechanisms to load setup modules. In Mocha.js, you can use the `--require` CLI option:

```bash
mocha --require react-native-testing-mocks/register
Expand Down

0 comments on commit 86e2277

Please sign in to comment.