Skip to content

Commit 720a75f

Browse files
committed
fix tests
1 parent cf49b39 commit 720a75f

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

packages/nextjs/test/config/loaders.test.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,22 @@ describe('webpack loaders', () => {
6060
});
6161

6262
describe('client loaders', () => {
63-
it("doesn't add `RewriteFrames` loader to client config", async () => {
63+
it('adds `RewriteFrames` loader to client config', async () => {
6464
const finalWebpackConfig = await materializeFinalWebpackConfig({
6565
exportedNextConfig,
6666
incomingWebpackConfig: clientWebpackConfig,
6767
incomingWebpackBuildContext: clientBuildContext,
6868
});
6969

70-
expect(finalWebpackConfig.module.rules).not.toContainEqual(
71-
expect.objectContaining({
72-
use: [
73-
{
74-
loader: expect.stringEndingWith('prefixLoader.js'),
75-
options: expect.objectContaining({ templatePrefix: expect.stringContaining('RewriteFrames') }),
76-
},
77-
],
78-
}),
79-
);
70+
expect(finalWebpackConfig.module.rules).toContainEqual({
71+
test: /sentry\.client\.config\.(jsx?|tsx?)/,
72+
use: [
73+
{
74+
loader: expect.stringEndingWith('prefixLoader.js'),
75+
options: expect.objectContaining({ templatePrefix: 'clientRewriteFrames' }),
76+
},
77+
],
78+
});
8079
});
8180
});
8281
});

packages/nextjs/test/index.client.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ describe('Client init()', () => {
6363
},
6464
},
6565
environment: 'test',
66-
integrations: [],
66+
integrations: expect.arrayContaining([
67+
expect.objectContaining({
68+
name: 'RewriteFrames',
69+
}),
70+
]),
6771
}),
6872
);
6973
});

0 commit comments

Comments
 (0)