Skip to content

Commit

Permalink
fix test and exclude inc cache path for edge
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jun 15, 2022
1 parent fe73b48 commit 53592c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/next/server/lib/incremental-cache/index.ts
Expand Up @@ -63,7 +63,7 @@ export class IncrementalCache {
}) {
let cacheHandlerMod: any = FileSystemCache

if (incrementalCacheHandlerPath) {
if (process.env.NEXT_RUNTIME !== 'edge' && incrementalCacheHandlerPath) {
cacheHandlerMod = require(incrementalCacheHandlerPath)
cacheHandlerMod = cacheHandlerMod.default || cacheHandlerMod
}
Expand Down
Expand Up @@ -29,19 +29,15 @@ function runTests() {
const browser = await webdriver(appPort, '/')
const text = await browser.elementByCss('#before-hydration').text()

expect(text).toBe(
'Index<!-- -->1<!-- -->2<!-- -->3<!-- -->4<!-- -->4<!-- -->'
)
expect(text).toBe('Index<!-- -->1<!-- -->2<!-- -->3<!-- -->4<!-- -->4')
expect(await browser.eval('window.caughtErrors')).toBe('')
})

it('should render dynamic server rendered values on client mount', async () => {
const browser = await webdriver(appPort, '/')
const text = await browser.elementByCss('#first-render').text()

expect(text).toBe(
'Index<!-- -->1<!-- -->2<!-- -->3<!-- -->4<!-- -->4<!-- -->'
)
expect(text).toBe('Index<!-- -->1<!-- -->2<!-- -->3<!-- -->4<!-- -->4')
expect(await browser.eval('window.caughtErrors')).toBe('')
})
}
Expand Down
4 changes: 1 addition & 3 deletions test/integration/next-dynamic/test/index.test.js
Expand Up @@ -29,9 +29,7 @@ function runTests() {
const text = await browser.elementByCss('#first-render').text()

// Failure case is 'Index<!-- -->3<!-- --><!-- -->'
expect(text).toBe(
'Index<!-- -->1<!-- -->2<!-- -->3<!-- -->4<!-- -->4<!-- -->'
)
expect(text).toBe('Index<!-- -->1<!-- -->2<!-- -->3<!-- -->4<!-- -->4')
expect(await browser.eval('window.caughtErrors')).toBe('')
})
}
Expand Down

0 comments on commit 53592c7

Please sign in to comment.