Skip to content

Commit 1d49fff

Browse files
committed
test: add unit test for frameworks API dirs
1 parent 9864c7c commit 1d49fff

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/build/plugin-context.test.ts

+17
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,20 @@ test('should use deploy configuration blobs directory when @netlify/build versio
211211

212212
expect(ctx.blobDir).toBe(join(cwd, '.netlify/deploy/v1/blobs/deploy'))
213213
})
214+
215+
test('should use frameworks API directories when @netlify/build version supports it', () => {
216+
const { cwd } = mockFileSystem({
217+
'.next/required-server-files.json': JSON.stringify({
218+
config: { distDir: '.next' },
219+
relativeAppDir: '',
220+
} as RequiredServerFilesManifest),
221+
})
222+
223+
const ctx = new PluginContext({
224+
constants: { NETLIFY_BUILD_VERSION: '29.50.5' },
225+
} as unknown as NetlifyPluginOptions)
226+
227+
expect(ctx.blobDir).toBe(join(cwd, '.netlify/v1/blobs/deploy'))
228+
expect(ctx.edgeFunctionsDir).toBe(join(cwd, '.netlify/v1/edge-functions'))
229+
expect(ctx.serverFunctionsDir).toBe(join(cwd, '.netlify/v1/functions'))
230+
})

0 commit comments

Comments
 (0)