Skip to content

Commit e3d1569

Browse files
Merge pull request #99 from byte-fe/greenkeeper/react-testing-library-7.0.0
Update react-testing-library to the latest version 🚀
2 parents 2f63239 + b20c638 commit e3d1569

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

__test__/actions/unmount.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/// <reference path="../index.d.ts" />
2+
import 'react-testing-library/cleanup-after-each'
3+
import { testHook } from 'react-hooks-testing-library'
4+
import { ActionsTester } from '../index'
5+
import { Model } from '../../src'
6+
7+
describe('actions', () => {
8+
test('call actions in action', async () => {
9+
const { useStore } = Model({ ActionsTester })
10+
let state: any
11+
let actions: any
12+
const { unmount } = testHook(() => {
13+
;[state, actions] = useStore('ActionsTester')
14+
})
15+
await actions.getData()
16+
unmount()
17+
expect(state.data).toEqual({ counter: 1000 })
18+
})
19+
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"react": "^16.8.4",
3939
"react-dom": "^16.8.4",
4040
"react-hooks-testing-library": "^0.4.0",
41-
"react-testing-library": "^6.0.0",
41+
"react-testing-library": "^7.0.0",
4242
"remark-cli": "^6.0.1",
4343
"remark-lint": "^6.0.4",
4444
"remark-preset-lint-recommended": "^3.0.2",

0 commit comments

Comments
 (0)