Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit aacbb24

Browse files
committed
fix error
1 parent e30fbac commit aacbb24

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-context-selector/test/createContext-test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('createContext', () => {
2828

2929
describe('options', () => {
3030
it('throws on usage outside Provider by default', () => {
31-
jest.spyOn(global.console, 'error').mockImplementation(() => {})
31+
jest.spyOn(console, 'error').mockImplementation(() => {})
3232

3333
const TestContext = createContext<string>('')
3434
const TestComponent: React.FC = () => {
@@ -48,6 +48,9 @@ describe('createContext', () => {
4848
message: 'Please use <Provider /> component from "@fluentui/react-context-selector"',
4949
}),
5050
)
51+
52+
// We need to clean up mocks to avoid errors reported by React
53+
;(console.error as any).mockClear()
5154
})
5255

5356
it('do not throw usage outside Provider when `strict` is `false`', () => {

0 commit comments

Comments
 (0)