Skip to content

Commit 6ed3fc1

Browse files
author
Kent C. Dodds
committed
fix example stuff
1 parent d780347 commit 6ed3fc1

File tree

5 files changed

+2
-8
lines changed

5 files changed

+2
-8
lines changed

examples/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ The examples have a unique jest/eslint set up so the test files will resemble
1111
how they might appear in your project. (You'll see in the tests that we can
1212
`import {render} from 'react-testing-library'`).
1313

14-
Another thing that we do for the tests is we have a `setup-test-env.js` file in
15-
the `other` directory of this repo which includes
16-
`import 'jest-dom/extend-expect'` which gives us a few handy assertions. It's
17-
recommended to use [`jest-dom`][jest-dom] with `react-testing-library`.
18-
1914
## Contribute
2015

2116
We're always happy to accept contributions to the examples. Can't have too many

examples/__tests__/react-context.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
22
import {render} from 'react-testing-library'
3+
import 'jest-dom/extend-expect'
34
import {NameContext, NameProvider, NameConsumer} from '../react-context'
45

56
/**

examples/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ const jestConfig = require('kcd-scripts/jest')
22

33
module.exports = Object.assign(jestConfig, {
44
rootDir: __dirname,
5+
roots: [__dirname],
56
displayName: 'example',
6-
setupTestFrameworkScriptFile: require.resolve('../other/setup-test-env'),
77
moduleNameMapper: {
88
// this is just here so our examples look like they would in a real project
99
'react-testing-library': require.resolve('../src'),

jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ const jestConfig = require('kcd-scripts/jest')
22

33
module.exports = Object.assign(jestConfig, {
44
displayName: 'library',
5-
setupTestFrameworkScriptFile: require.resolve('./other/setup-test-env'),
65
})

other/setup-test-env.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)