Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
fix: react-hooks/exhaustive-deps warnings do not appear when running
Browse files Browse the repository at this point in the history
Co-authored-by: Matteo Vivona <[email protected]>
  • Loading branch information
Tomastomaslol and matteovivona authored Aug 18, 2020
1 parent 6911b7b commit 6434fd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
'jest/globals': true,
},
extends: [
'react-app',
'airbnb',
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { renderHook } from '@testing-library/react-hooks'
import { render, shallow } from 'enzyme'
import React from 'react'

Expand All @@ -16,10 +17,9 @@ const englishTranslationsMock = {
'networkStatus.online': 'you are back online',
}

const useTranslationReturnValue = useTranslation() as any
useTranslationReturnValue.t = (key: keyof typeof englishTranslationsMock) =>
englishTranslationsMock[key]
const { t } = useTranslationReturnValue
const { result } = renderHook(() => useTranslation() as any)
result.current.t = (key: keyof typeof englishTranslationsMock) => englishTranslationsMock[key]
const { t } = result.current

describe('NetworkStatusMessage', () => {
it('returns null if the app has always been online', () => {
Expand Down

1 comment on commit 6434fd0

@vercel
Copy link

@vercel vercel bot commented on 6434fd0 Aug 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.