Skip to content

Commit

Permalink
enable tests and disable lint
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jun 7, 2022
1 parent ebd1dd6 commit 7aae246
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions packages/next/shared/lib/side-effect.tsx
Expand Up @@ -28,8 +28,10 @@ export default function SideEffect(props: SideEffectProps) {
if (typeof window === 'undefined') {
headManager?.mountedInstances?.add(props.children)
emitChange()
return null
}

// eslint-disable-next-line react-hooks/rules-of-hooks
useLayoutEffect(() => {
headManager?.mountedInstances?.add(props.children)
return () => {
Expand All @@ -39,12 +41,14 @@ export default function SideEffect(props: SideEffectProps) {

// Cache emitChange in headManager in layout effects and execute later in effects.
// Since `useEffect` is async effects emitChange will only keep the latest results.
// eslint-disable-next-line react-hooks/rules-of-hooks
useLayoutEffect(() => {
if (headManager) {
headManager._pendingUpdate = emitChange
}
})

// eslint-disable-next-line react-hooks/rules-of-hooks
useEffect(() => {
if (headManager && headManager._pendingUpdate) {
headManager._pendingUpdate()
Expand Down
2 changes: 0 additions & 2 deletions test/integration/client-navigation-a11y/next.config.js

This file was deleted.

2 changes: 0 additions & 2 deletions test/integration/client-navigation-a11y/test/index.test.js
Expand Up @@ -11,7 +11,6 @@ import { join } from 'path'

const context = {}
const appDir = join(__dirname, '../')
const nodeArgs = ['-r', join(appDir, '../../lib/react-17-require-hook.js')]

const navigateTo = async (browser, selector) =>
await browser
Expand All @@ -32,7 +31,6 @@ describe('Client Navigation accessibility', () => {
context.appPort = await findPort()
context.server = await launchApp(appDir, context.appPort, {
env: { __NEXT_TEST_WITH_DEVTOOL: 1 },
nodeArgs,
})

const prerender = [
Expand Down

0 comments on commit 7aae246

Please sign in to comment.