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

Split webpack specific test into separate test suite #66328

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 0 additions & 14 deletions test/e2e/app-dir/rsc-basic/rsc-basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,20 +606,6 @@ describe('app dir - rsc basics', () => {
)
})

// Skip as Turbopack doesn't support webpack loaders.
;(process.env.TURBOPACK ? it.skip : it)(
'should support webpack loader rules',
async () => {
const browser = await next.browser('/loader-rule')

expect(
await browser.eval(
`window.getComputedStyle(document.querySelector('#red')).color`
)
).toBe('rgb(255, 0, 0)')
}
)

if (isNextStart) {
it('should generate edge SSR manifests for Node.js', async () => {
const requiredServerFiles = JSON.parse(
Expand Down
12 changes: 12 additions & 0 deletions test/e2e/app-dir/rsc-webpack-loader/app/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react'

export default function AppLayout({ children }) {
return (
<html>
<head>
<title>RSC</title>
</head>
<body>{children}</body>
</html>
)
}
17 changes: 17 additions & 0 deletions test/e2e/app-dir/rsc-webpack-loader/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
reactStrictMode: true,
onDemandEntries: {
maxInactiveAge: 1000 * 60 * 60,
},
serverExternalPackages: ['conditional-exports-optout'],
rewrites: async () => {
return {
afterFiles: [
{
source: '/rewritten-to-edge-dynamic',
destination: '/edge/dynamic',
},
],
}
},
}
30 changes: 30 additions & 0 deletions test/e2e/app-dir/rsc-webpack-loader/rsc-webpack-loader.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { nextTestSetup } from 'e2e-utils'
;(process.env.TURBOPACK ? describe.skip : describe)(
'app dir - rsc webpack loader',
() => {
const { next } = nextTestSetup({
files: __dirname,
dependencies: {
'styled-components': 'latest',
'server-only': 'latest',
},
resolutions: {
'@babel/core': '7.22.18',
'@babel/parser': '7.22.16',
'@babel/types': '7.22.17',
'@babel/traverse': '7.22.18',
},
})

// Skip as Turbopack doesn't support webpack loaders.
it('should support webpack loader rules', async () => {
const browser = await next.browser('/loader-rule')

expect(
await browser.eval(
`window.getComputedStyle(document.querySelector('#red')).color`
)
).toBe('rgb(255, 0, 0)')
})
}
)
3 changes: 1 addition & 2 deletions test/turbopack-build-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3020,8 +3020,7 @@
],
"pending": [
"app dir - rsc basics should not use bundled react for pages with app",
"app dir - rsc basics should support partial hydration with inlined server data in browser",
"app dir - rsc basics should support webpack loader rules"
"app dir - rsc basics should support partial hydration with inlined server data in browser"
],
"flakey": [],
"runtimeError": false
Expand Down
3 changes: 1 addition & 2 deletions test/turbopack-dev-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5144,8 +5144,7 @@
"failed": [],
"pending": [
"app dir - rsc basics should not use bundled react for pages with app",
"app dir - rsc basics should support partial hydration with inlined server data in browser",
"app dir - rsc basics should support webpack loader rules"
"app dir - rsc basics should support partial hydration with inlined server data in browser"
],
"flakey": [],
"runtimeError": false
Expand Down
Loading