|
1 | 1 | import { generateRscDataEdgeManifest } from '../packages/runtime/src/helpers/edge'
|
2 | 2 | import type { PrerenderManifest } from 'next/dist/build'
|
3 | 3 |
|
| 4 | +jest.mock('../packages/runtime/src/helpers/functionsMetaData', () => { |
| 5 | + const { NEXT_PLUGIN_NAME } = require('../packages/runtime/src/constants') |
| 6 | + return { |
| 7 | + ...jest.requireActual('../packages/runtime/src/helpers/functionsMetaData'), |
| 8 | + getPluginVersion: async () => `${NEXT_PLUGIN_NAME}@1.0.0`, |
| 9 | + } |
| 10 | +}) |
| 11 | + |
4 | 12 | const basePrerenderManifest: PrerenderManifest = {
|
5 | 13 | version: 3,
|
6 | 14 | routes: {},
|
@@ -33,11 +41,13 @@ describe('generateRscDataEdgeManifest', () => {
|
33 | 41 | expect(edgeManifest).toEqual([
|
34 | 42 | {
|
35 | 43 | function: 'rsc-data',
|
| 44 | + generator: "@netlify/[email protected]", |
36 | 45 | name: 'RSC data routing',
|
37 | 46 | path: '/',
|
38 | 47 | },
|
39 | 48 | {
|
40 | 49 | function: 'rsc-data',
|
| 50 | + generator: "@netlify/[email protected]", |
41 | 51 | name: 'RSC data routing',
|
42 | 52 | path: '/index.rsc',
|
43 | 53 | },
|
@@ -84,11 +94,13 @@ describe('generateRscDataEdgeManifest', () => {
|
84 | 94 | expect(edgeManifest).toEqual([
|
85 | 95 | {
|
86 | 96 | function: 'rsc-data',
|
| 97 | + generator: "@netlify/[email protected]", |
87 | 98 | name: 'RSC data routing',
|
88 | 99 | pattern: '^/blog/([^/]+?)(?:/)?$',
|
89 | 100 | },
|
90 | 101 | {
|
91 | 102 | function: 'rsc-data',
|
| 103 | + generator: "@netlify/[email protected]", |
92 | 104 | name: 'RSC data routing',
|
93 | 105 | pattern: '^/blog/([^/]+?)\\.rsc$',
|
94 | 106 | },
|
|
0 commit comments