Skip to content

Commit a86ca4e

Browse files
committed
test(remix): Fix integration test flakes
1 parent c915357 commit a86ca4e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/remix/test/integration/test/client/root-loader.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ test('should inject `sentry-trace` and `baggage` into root loader throwing a red
125125
}) => {
126126
await page.goto('/?type=throwRedirect');
127127

128+
const { sentryTrace, sentryBaggage } = await extractTraceAndBaggageFromMeta(page);
129+
128130
// We should be successfully redirected to the path.
129131
expect(page.url()).toEqual(expect.stringContaining('/?type=plain'));
130132

131-
const { sentryTrace, sentryBaggage } = await extractTraceAndBaggageFromMeta(page);
132-
133133
expect(sentryTrace).toMatch(/.+/);
134134
expect(sentryBaggage).toMatch(/.+/);
135135

@@ -146,11 +146,11 @@ test('should inject `sentry-trace` and `baggage` into root loader returning a re
146146
}) => {
147147
await page.goto('/?type=returnRedirect');
148148

149+
const { sentryTrace, sentryBaggage } = await extractTraceAndBaggageFromMeta(page);
150+
149151
// We should be successfully redirected to the path.
150152
expect(page.url()).toEqual(expect.stringContaining('/?type=plain'));
151153

152-
const { sentryTrace, sentryBaggage } = await extractTraceAndBaggageFromMeta(page);
153-
154154
expect(sentryTrace).toMatch(/.+/);
155155
expect(sentryBaggage).toMatch(/.+/);
156156

@@ -165,23 +165,23 @@ test('should inject `sentry-trace` and `baggage` into root loader returning a re
165165
test('should return redirect to an external path with no baggage and trace injected.', async ({ page }) => {
166166
await page.goto('/?type=returnRedirectToExternal');
167167

168+
const { sentryTrace, sentryBaggage } = await extractTraceAndBaggageFromMeta(page);
169+
168170
// We should be successfully redirected to the external path.
169171
expect(page.url()).toEqual(expect.stringContaining('https://example.com'));
170172

171-
const { sentryTrace, sentryBaggage } = await extractTraceAndBaggageFromMeta(page);
172-
173173
expect(sentryTrace).toBeUndefined();
174174
expect(sentryBaggage).toBeUndefined();
175175
});
176176

177177
test('should throw redirect to an external path with no baggage and trace injected.', async ({ page }) => {
178178
await page.goto('/?type=throwRedirectToExternal');
179179

180+
const { sentryTrace, sentryBaggage } = await extractTraceAndBaggageFromMeta(page);
181+
180182
// We should be successfully redirected to the external path.
181183
expect(page.url()).toEqual(expect.stringContaining('https://example.com'));
182184

183-
const { sentryTrace, sentryBaggage } = await extractTraceAndBaggageFromMeta(page);
184-
185185
expect(sentryTrace).toBeUndefined();
186186
expect(sentryBaggage).toBeUndefined();
187187
});

0 commit comments

Comments
 (0)