Unverified Commit 3f06bc37 authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

Update server action and collect test expectations

Co-authored-by: 's avatarNiklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
parent 5b6819a0
/* __next_internal_action_entry_do_not_use__ [{"006a88810ecce4a4e8b59d53b8327d7e98bbf251d7":{"name":"$$RSC_SERVER_ACTION_0"}},"/app/item.js",""] */ 'use client'; 'use client';
'use strict'; 'use strict';
import { registerServerReference } from "private-next-rsc-server-reference"; import { registerServerReference } from "private-next-rsc-server-reference";
export const $$RSC_SERVER_ACTION_0 = async function action() {}; export const $$RSC_SERVER_ACTION_0 = async function action() {};
registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null); registerServerReference($$RSC_SERVER_ACTION_0, "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7", null);
__turbopack_emit__("./item.js", {
namespace: process.env.NEXT_RUNTIME === 'nodejs' ? 'next/server-actions/rsc-nodejs' : 'next/server-actions/rsc-edge',
data: "006a88810ecce4a4e8b59d53b8327d7e98bbf251d7\0$$RSC_SERVER_ACTION_0\0/app/item.js"
});
export default function Page() { export default function Page() {
return <form action={$$RSC_SERVER_ACTION_0}/>; return <form action={$$RSC_SERVER_ACTION_0}/>;
} }
...@@ -23,17 +23,17 @@ describe('actions-edge-mixed', () => { ...@@ -23,17 +23,17 @@ describe('actions-edge-mixed', () => {
if (isNextDev && isTurbopack) { if (isNextDev && isTurbopack) {
// Only relevant for Turbopack, and the other bundlers don't output that edge error. // Only relevant for Turbopack, and the other bundlers don't output that edge error.
it('should only compile for edge when page runtime is set', async () => { it('should only compile for edge when page runtime is set', async () => {
await next.browser('/client-error') await next.browser('/node')
expect(next.cliOutput).not.toContain( expect(next.cliOutput).not.toContain(
'which is not supported in the Edge Runtime.' 'which is not supported in the Edge Runtime.'
) )
const output = next.getCliOutputFromHere() const output = next.getCliOutputFromHere()
await next.patchFile( await next.patchFile(
'app/client-error/page.js', 'app/node/page.tsx',
(origContent) => origContent + `\nexport const runtime = "edge";`, (origContent) => origContent + `\nexport const runtime = "edge";`,
async () => { async () => {
await retry(async () => { await retry(async () => {
await next.browser('/client-error') await next.browser('/node')
expect(output()).toContain( expect(output()).toContain(
'which is not supported in the Edge Runtime.' 'which is not supported in the Edge Runtime.'
) )
......
...@@ -7,14 +7,14 @@ const getList = __turbopack_collect__({ ...@@ -7,14 +7,14 @@ const getList = __turbopack_collect__({
it('should work', async () => { it('should work', async () => {
const list = getList() const list = getList()
expect(list).toEqual([ expect(list).toEqual([
expect.objectContaining({
id: '[project]/turbopack/crates/turbopack-tests/tests/execution/turbopack/collect/basic/input/b.js [test] (ecmascript)',
data: 'more-data-for-b',
}),
expect.objectContaining({ expect.objectContaining({
id: '[project]/turbopack/crates/turbopack-tests/tests/execution/turbopack/collect/basic/input/c.js [test] (ecmascript)', id: '[project]/turbopack/crates/turbopack-tests/tests/execution/turbopack/collect/basic/input/c.js [test] (ecmascript)',
data: 'data-for-c', data: 'data-for-c',
}), }),
expect.objectContaining({
id: '[project]/turbopack/crates/turbopack-tests/tests/execution/turbopack/collect/basic/input/b.js [test] (ecmascript)',
data: 'more-data-for-b',
}),
expect.objectContaining({ expect.objectContaining({
id: '[project]/turbopack/crates/turbopack-tests/tests/execution/turbopack/collect/basic/input/a.js [test] (ecmascript)', id: '[project]/turbopack/crates/turbopack-tests/tests/execution/turbopack/collect/basic/input/a.js [test] (ecmascript)',
data: 'data-for-a', data: 'data-for-a',
...@@ -25,7 +25,7 @@ it('should work', async () => { ...@@ -25,7 +25,7 @@ it('should work', async () => {
}), }),
]) ])
const [b2, c, a, b1] = list const [c, b2, a, b1] = list
expect((await a.import()).a()).toEqual('this is a.js') expect((await a.import()).a()).toEqual('this is a.js')
expect((await b1.import()).b()).toEqual('this is b.js') expect((await b1.import()).b()).toEqual('this is b.js')
expect((await c.import()).c()).toEqual('this is c.js') expect((await c.import()).c()).toEqual('this is c.js')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment