Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Turbopack test skip for scss test #63649

Merged
merged 1 commit into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ describe('Dynamic Route CSS Module Usage', () => {
sass: '1.54.0',
},
})
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
it('should apply styles correctly', async () => {
const browser = await next.browser('/post-1')
it('should apply styles correctly', async () => {
const browser = await next.browser('/post-1')

const background = await browser
.elementByCss('#my-div')
.getComputedCss('background-color')
const background = await browser
.elementByCss('#my-div')
.getComputedCss('background-color')

expect(background).toMatch(colorToRgb('red'))
})
expect(background).toMatch(colorToRgb('red'))
})
})
130 changes: 64 additions & 66 deletions test/production/graceful-shutdown/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,86 +33,84 @@ describe('Graceful Shutdown', () => {

runTests(true)
})
;(process.env.TURBOPACK ? describe.skip : describe)(
'production (next start)',
() => {
beforeAll(async () => {
await nextBuild(appDir)
})
beforeEach(async () => {
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
afterEach(() => killApp(app))
;(process.env.TURBOPACK && !process.env.TURBOPACK_BUILD
? describe.skip
: describe)('production (next start)', () => {
beforeAll(async () => {
await nextBuild(appDir)
})
beforeEach(async () => {
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
afterEach(() => killApp(app))

runTests()
runTests()
})
;(process.env.TURBOPACK && !process.env.TURBOPACK_BUILD
? describe.skip
: describe)('production (standalone mode)', () => {
let next: NextInstance
let serverFile

const projectFiles = {
'next.config.mjs': `export default { output: 'standalone' }`,
}
)
;(process.env.TURBOPACK ? describe.skip : describe)(
'production (standalone mode)',
() => {
let next: NextInstance
let serverFile

const projectFiles = {
'next.config.mjs': `export default { output: 'standalone' }`,
}

for (const file of glob.sync('*', { cwd: appDir, dot: false })) {
projectFiles[file] = new FileRef(join(appDir, file))
}
for (const file of glob.sync('*', { cwd: appDir, dot: false })) {
projectFiles[file] = new FileRef(join(appDir, file))
}

beforeAll(async () => {
next = await createNext({
files: projectFiles,
dependencies: {
swr: 'latest',
},
})
beforeAll(async () => {
next = await createNext({
files: projectFiles,
dependencies: {
swr: 'latest',
},
})

await next.stop()
await next.stop()

await fs.move(
join(next.testDir, '.next/standalone'),
join(next.testDir, 'standalone')
)
await fs.move(
join(next.testDir, '.next/standalone'),
join(next.testDir, 'standalone')
)

for (const file of await fs.readdir(next.testDir)) {
if (file !== 'standalone') {
await fs.remove(join(next.testDir, file))
}
for (const file of await fs.readdir(next.testDir)) {
if (file !== 'standalone') {
await fs.remove(join(next.testDir, file))
}
const files = glob.sync('**/*', {
cwd: join(next.testDir, 'standalone/.next/server/pages'),
dot: true,
})
}
const files = glob.sync('**/*', {
cwd: join(next.testDir, 'standalone/.next/server/pages'),
dot: true,
})

for (const file of files) {
if (file.endsWith('.json') || file.endsWith('.html')) {
await fs.remove(join(next.testDir, '.next/server', file))
}
for (const file of files) {
if (file.endsWith('.json') || file.endsWith('.html')) {
await fs.remove(join(next.testDir, '.next/server', file))
}
}

serverFile = join(next.testDir, 'standalone/server.js')
})
serverFile = join(next.testDir, 'standalone/server.js')
})

beforeEach(async () => {
appPort = await findPort()
app = await initNextServerScript(
serverFile,
/- Local:/,
{ ...process.env, PORT: appPort.toString() },
undefined,
{ cwd: next.testDir }
)
})
afterEach(() => killApp(app))
beforeEach(async () => {
appPort = await findPort()
app = await initNextServerScript(
serverFile,
/- Local:/,
{ ...process.env, PORT: appPort.toString() },
undefined,
{ cwd: next.testDir }
)
})
afterEach(() => killApp(app))

afterAll(() => next.destroy())
afterAll(() => next.destroy())

runTests()
}
)
runTests()
})
})

function runTests(dev = false) {
Expand Down