Skip to content

Commit

Permalink
change eslint exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Nov 19, 2024
1 parent 992e263 commit a313108
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/react/async.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ const useCommitCount = () => {
return commitCountRef.current
}

/* eslint-disable testing-library/no-unnecessary-act */
const renderRoot = async (element: ReactNode) => {
const container = document.body.appendChild(document.createElement('div'))
const root = createRoot(container)
// eslint-disable-next-line testing-library/no-unnecessary-act
await act(async () => {
root.render(element)
})
return {
userEvent: {
click: async (el: Element) => {
// eslint-disable-next-line testing-library/no-unnecessary-act
await act(() => userEvent.click(el))
},
},
Expand Down
3 changes: 2 additions & 1 deletion tests/react/basic.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ const useCommitCount = () => {
return commitCountRef.current
}

/* eslint-disable testing-library/no-unnecessary-act */
const renderRoot = async (element: ReactNode) => {
const container = document.body.appendChild(document.createElement('div'))
const root = createRoot(container)
// eslint-disable-next-line testing-library/no-unnecessary-act
await act(async () => {
root.render(element)
})
return {
userEvent: {
click: async (el: Element) => {
// eslint-disable-next-line testing-library/no-unnecessary-act
await act(() => userEvent.click(el))
},
},
Expand Down

0 comments on commit a313108

Please sign in to comment.