Skip to content

Commit 460fa36

Browse files
committed
Add a test for URL without a pathname
1 parent d7c6e9d commit 460fa36

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/nextjs/test/config/webpack/sentryWebpackPlugin.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,26 @@ describe('Sentry webpack plugin config', () => {
337337
});
338338

339339
it('has the correct value when given a full URL', async () => {
340+
const exportedNextConfigWithAssetPrefix = {
341+
...exportedNextConfig,
342+
assetPrefix: 'https://cdn.mydomain.com',
343+
};
344+
const buildContext = getBuildContext('client', exportedNextConfigWithAssetPrefix);
345+
const finalWebpackConfig = await materializeFinalWebpackConfig({
346+
exportedNextConfig: exportedNextConfigWithAssetPrefix,
347+
incomingWebpackConfig: clientWebpackConfig,
348+
incomingWebpackBuildContext: buildContext,
349+
});
350+
351+
const sentryWebpackPluginInstance = findWebpackPlugin(
352+
finalWebpackConfig,
353+
'SentryCliPlugin',
354+
) as SentryWebpackPlugin;
355+
356+
expect(sentryWebpackPluginInstance.options.urlPrefix).toEqual('~/_next');
357+
});
358+
359+
it('has the correct value when given a full URL with a path', async () => {
340360
const exportedNextConfigWithAssetPrefix = {
341361
...exportedNextConfig,
342362
assetPrefix: 'https://cdn.mydomain.com/asset-prefix',

0 commit comments

Comments
 (0)