Skip to content

Commit 8ea99bf

Browse files
committed
Fix test
1 parent 2861218 commit 8ea99bf

File tree

1 file changed

+25
-30
lines changed

1 file changed

+25
-30
lines changed
Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1+
/* eslint-disable jest/no-standalone-expect */
12
import { nextTestSetup } from 'e2e-utils'
3+
;(process.env.IS_TURBOPACK_TEST ? describe : describe.skip)(
4+
'turbopack-turbo-config-compatibility',
5+
() => {
6+
describe('including both turbopack and deprecated experimental turbo config', () => {
7+
const { next } = nextTestSetup({
8+
files: __dirname,
9+
})
210

3-
describe('turbopack-turbo-config-compatibility', () => {
4-
describe('including both turbopack and deprecated experimental turbo config', () => {
5-
const { next, isTurbopack } = nextTestSetup({
6-
files: __dirname,
11+
it('prefers turbopack config over deprecated experimental turbo config', async () => {
12+
const $ = await next.render$('/')
13+
expect($('#result').text()).toEqual('Hello turbopack')
14+
})
715
})
816

9-
if (!isTurbopack) {
10-
return
11-
}
12-
13-
it('prefers turbopack config over deprecated experimental turbo config', async () => {
14-
const $ = await next.render$('/')
15-
expect($('#result').text()).toEqual('Hello turbopack')
16-
})
17-
})
18-
19-
describe('only including deprecated experimental turbo config', () => {
20-
const { next, isTurbopack } = nextTestSetup({
21-
files: __dirname,
22-
overrideFiles: {
23-
'next.config.js': `module.exports = {
17+
describe('only including deprecated experimental turbo config', () => {
18+
const { next } = nextTestSetup({
19+
files: __dirname,
20+
overrideFiles: {
21+
'next.config.js': `module.exports = {
2422
experimental: {
2523
turbo: {
2624
resolveAlias: {
@@ -29,16 +27,13 @@ describe('turbopack-turbo-config-compatibility', () => {
2927
},
3028
},
3129
}`,
32-
},
33-
})
34-
35-
if (!isTurbopack) {
36-
return
37-
}
30+
},
31+
})
3832

39-
it('still uses the deprecated experimental turbo config', async () => {
40-
const $ = await next.render$('/')
41-
expect($('#result').text()).toEqual('Hello turbo')
33+
it('still uses the deprecated experimental turbo config', async () => {
34+
const $ = await next.render$('/')
35+
expect($('#result').text()).toEqual('Hello turbo')
36+
})
4237
})
43-
})
44-
})
38+
}
39+
)

0 commit comments

Comments
 (0)