@@ -4,12 +4,12 @@ title: Setup
44sidebar_label : Setup
55---
66
7- ` React Testing Library ` does not require any configuration to be used (as
8- demonstrated in the example above). However, there are some things you can do
9- when configuring your testing framework to reduce some boilerplate. In these
10- docs we'll demonstrate configuring Jest, but you should be able to do similar
11- things with [ any testing framework] ( #using-without-jest ) (React Testing Library
12- does not require that you use Jest).
7+ ` React Testing Library ` does not require any configuration to be used. However,
8+ there are some things you can do when configuring your testing framework to
9+ reduce some boilerplate. In these docs we'll demonstrate configuring Jest, but
10+ you should be able to do similar things with
11+ [ any testing framework] ( #using-without-jest ) (React Testing Library does not
12+ require that you use Jest).
1313
1414## Global Config
1515
@@ -25,8 +25,8 @@ approach is to define a utility file that re-exports everything from
2525all your imports. See [ below] ( #configuring-jest-with-test-utils ) for a way to
2626make your test util file accessible without using relative paths.
2727
28- The example below sets up data providers using the
29- [ ` wrapper ` ] ( api.md#wrapper ) option to ` render ` .
28+ The example below sets up data providers using the [ ` wrapper ` ] ( api.md#wrapper )
29+ option to ` render ` .
3030
3131``` diff
3232// my-component.test.js
@@ -36,7 +36,7 @@ The example below sets up data providers using the
3636
3737``` js
3838// test-utils.js
39- import React from " react"
39+ import React from ' react'
4040import { render } from ' @testing-library/react'
4141import { ThemeProvider } from ' my-ui-lib'
4242import { TranslationProvider } from ' my-i18n-lib'
@@ -103,8 +103,8 @@ module.exports = {
103103
104104You can define your own custom queries as described in the example in the
105105[ Helpers API] ( /docs/dom-testing-library/api-helpers ) documentation, or via the
106- [ ` buildQueries ` ] ( /docs/dom-testing-library/api-helpers#buildqueries ) helper. Then
107- you can use them in any render call using the ` queries ` option. To make the
106+ [ ` buildQueries ` ] ( /docs/dom-testing-library/api-helpers#buildqueries ) helper.
107+ Then you can use them in any render call using the ` queries ` option. To make the
108108custom queries available globally, you can add them to your custom render method
109109as shown below.
110110
@@ -328,6 +328,6 @@ Or with mocha's `-r` flag:
328328mocha -r @testing-library/react/dont-cleanup-after-each
329329```
330330
331- Alternatively, you could import ` @testing-library/react/pure ` in all your
332- tests that you don't want the ` cleanup ` to run and the ` afterEach ` won't
333- be setup automatically.
331+ Alternatively, you could import ` @testing-library/react/pure ` in all your tests
332+ that you don't want the ` cleanup ` to run and the ` afterEach ` won't be setup
333+ automatically.
0 commit comments