Skip to content

Commit aeb5cb2

Browse files
committed
Apply biome fmt fixes
1 parent cb6d651 commit aeb5cb2

File tree

15 files changed

+96
-93
lines changed

15 files changed

+96
-93
lines changed

dev-packages/e2e-tests/test-applications/create-remix-app-fastify-vite/.eslintrc.cjs

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
module.exports = {
99
root: true,
1010
parserOptions: {
11-
ecmaVersion: "latest",
12-
sourceType: "module",
11+
ecmaVersion: 'latest',
12+
sourceType: 'module',
1313
ecmaFeatures: {
1414
jsx: true,
1515
},
@@ -19,63 +19,59 @@ module.exports = {
1919
commonjs: true,
2020
es6: true,
2121
},
22-
ignorePatterns: ["!**/.server", "!**/.client"],
22+
ignorePatterns: ['!**/.server', '!**/.client'],
2323

2424
// Base config
25-
extends: ["eslint:recommended"],
25+
extends: ['eslint:recommended'],
2626

2727
overrides: [
2828
// React
2929
{
30-
files: ["**/*.{js,jsx,ts,tsx}"],
31-
plugins: ["react", "jsx-a11y"],
30+
files: ['**/*.{js,jsx,ts,tsx}'],
31+
plugins: ['react', 'jsx-a11y'],
3232
extends: [
33-
"plugin:react/recommended",
34-
"plugin:react/jsx-runtime",
35-
"plugin:react-hooks/recommended",
36-
"plugin:jsx-a11y/recommended",
33+
'plugin:react/recommended',
34+
'plugin:react/jsx-runtime',
35+
'plugin:react-hooks/recommended',
36+
'plugin:jsx-a11y/recommended',
3737
],
3838
settings: {
3939
react: {
40-
version: "detect",
40+
version: 'detect',
4141
},
42-
formComponents: ["Form"],
42+
formComponents: ['Form'],
4343
linkComponents: [
44-
{ name: "Link", linkAttribute: "to" },
45-
{ name: "NavLink", linkAttribute: "to" },
44+
{ name: 'Link', linkAttribute: 'to' },
45+
{ name: 'NavLink', linkAttribute: 'to' },
4646
],
47-
"import/resolver": {
47+
'import/resolver': {
4848
typescript: {},
4949
},
5050
},
5151
},
5252

5353
// Typescript
5454
{
55-
files: ["**/*.{ts,tsx}"],
56-
plugins: ["@typescript-eslint", "import"],
57-
parser: "@typescript-eslint/parser",
55+
files: ['**/*.{ts,tsx}'],
56+
plugins: ['@typescript-eslint', 'import'],
57+
parser: '@typescript-eslint/parser',
5858
settings: {
59-
"import/internal-regex": "^~/",
60-
"import/resolver": {
59+
'import/internal-regex': '^~/',
60+
'import/resolver': {
6161
node: {
62-
extensions: [".ts", ".tsx"],
62+
extensions: ['.ts', '.tsx'],
6363
},
6464
typescript: {
6565
alwaysTryTypes: true,
6666
},
6767
},
6868
},
69-
extends: [
70-
"plugin:@typescript-eslint/recommended",
71-
"plugin:import/recommended",
72-
"plugin:import/typescript",
73-
],
69+
extends: ['plugin:@typescript-eslint/recommended', 'plugin:import/recommended', 'plugin:import/typescript'],
7470
},
7571

7672
// Node
7773
{
78-
files: [".eslintrc.cjs", "server.js"],
74+
files: ['.eslintrc.cjs', 'server.js'],
7975
env: {
8076
node: true,
8177
},

dev-packages/e2e-tests/test-applications/create-remix-app-fastify-vite/app/entry.client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { RemixBrowser, useLocation, useMatches } from '@remix-run/react';
22
import * as Sentry from '@sentry/remix';
3-
import type { ISentry } from 'types';
43
import { StrictMode, startTransition, useEffect } from 'react';
54
import { hydrateRoot } from 'react-dom/client';
5+
import type { ISentry } from 'types';
66

77
Sentry.init({
88
environment: 'qa', // dynamic sampling bias to keep transactions

dev-packages/e2e-tests/test-applications/create-remix-app-fastify-vite/app/entry.server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as Sentry from '@sentry/remix';
21
import fsp from 'node:fs/promises';
32
import util from 'node:util';
3+
import * as Sentry from '@sentry/remix';
44

55
Sentry.init({
66
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!

dev-packages/e2e-tests/test-applications/create-remix-app-fastify-vite/app/routes/_index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { MetaFunction } from '@remix-run/node';
12
import { Link, useSearchParams } from '@remix-run/react';
23
import * as Sentry from '@sentry/remix';
3-
import { MetaFunction } from '@remix-run/node';
44

55
// we will then demonstrate in out e2e tests that `sentry-trace` and `babbage`
66
// are inhereted and play nicely with route-level meta info

dev-packages/e2e-tests/test-applications/create-remix-app-fastify-vite/playwright.config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,24 @@ const config: PlaywrightTestConfig = {
4242

4343
/* Configure projects for major browsers */
4444
projects: [
45-
{ name: "setup", testMatch: /global\.setup\.ts/, teardown: "teardown" },
45+
{ name: 'setup', testMatch: /global\.setup\.ts/, teardown: 'teardown' },
4646
{
4747
name: 'chromium',
4848
use: {
4949
...devices['Desktop Chrome'],
5050
},
51-
dependencies: ["setup"]
51+
dependencies: ['setup'],
5252
},
53-
{ name: "teardown", testMatch: /global\.teardown\.ts/},
53+
{ name: 'teardown', testMatch: /global\.teardown\.ts/ },
5454
],
5555

5656
/* Run your local dev server before starting the tests */
5757
webServer: [
5858
{
5959
command: `PORT=${PORT} pnpm dev:events`,
6060
port: PORT,
61-
stdout: "pipe",
62-
stderr: "pipe",
61+
stdout: 'pipe',
62+
stderr: 'pipe',
6363
},
6464
],
6565
};

dev-packages/e2e-tests/test-applications/create-remix-app-fastify-vite/server.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import path from 'node:path';
22
import { fileURLToPath } from 'node:url';
3-
import { wrapFastifyCreateRequestHandler } from '@sentry/remix';
4-
import { installGlobals } from '@remix-run/node';
5-
import { createRequestHandler } from '@mcansh/remix-fastify';
6-
import fastify from 'fastify';
73
import compression from '@fastify/compress';
84
import middie from '@fastify/middie';
95
import multipart from '@fastify/multipart';
106
import serveStatic from '@fastify/static';
7+
import { createRequestHandler } from '@mcansh/remix-fastify';
8+
import { installGlobals } from '@remix-run/node';
9+
import { wrapFastifyCreateRequestHandler } from '@sentry/remix';
10+
import fastify from 'fastify';
1111

1212
const __filename = fileURLToPath(import.meta.url);
1313
const __dirname = path.dirname(__filename);
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
21
import { default as Axios } from 'axios';
32

43
const authToken = process.env.E2E_TEST_AUTH_TOKEN;
54
const sentryTestOrgSlug = process.env.E2E_TEST_SENTRY_ORG_SLUG;
65
const sentryTestProject = process.env.E2E_TEST_SENTRY_TEST_PROJECT;
76

8-
export const axios = Axios.create(
9-
{
10-
baseURL: `https://sentry.io/api/0/projects/${sentryTestOrgSlug}/${sentryTestProject}`,
11-
headers: { Authorization: `Bearer ${authToken}` } }
12-
);
7+
export const axios = Axios.create({
8+
baseURL: `https://sentry.io/api/0/projects/${sentryTestOrgSlug}/${sentryTestProject}`,
9+
headers: { Authorization: `Bearer ${authToken}` },
10+
});
1311

14-
export { AxiosError } from "axios";
12+
export { AxiosError } from 'axios';

dev-packages/e2e-tests/test-applications/create-remix-app-fastify-vite/tests/behaviour-client.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test('Sends a client-side exception to Sentry', async ({ page }) => {
2323
} catch (e) {
2424
const notThereJustYet = e instanceof AxiosError && e.response && e.response.status === 404;
2525
if (notThereJustYet) return 404;
26-
throw e
26+
throw e;
2727
}
2828
},
2929
{
@@ -38,7 +38,7 @@ test('Sends a pageload transaction to Sentry', async ({ page }) => {
3838

3939
const recordedTransactionsHandle = await page.waitForFunction(() => {
4040
const hasTransactions = Array.isArray(window.recordedTransactions) && window.recordedTransactions.length >= 1;
41-
if (hasTransactions) return window.recordedTransactions
41+
if (hasTransactions) return window.recordedTransactions;
4242
});
4343
const eventIds = await recordedTransactionsHandle.jsonValue();
4444
if (!eventIds) throw new Error("Application didn't record any transaction event IDs.");
@@ -58,7 +58,7 @@ test('Sends a pageload transaction to Sentry', async ({ page }) => {
5858
} catch (e) {
5959
const notThereJustYet = e instanceof AxiosError && e.response && e.response.status === 404;
6060
if (notThereJustYet) return 404;
61-
throw e
61+
throw e;
6262
}
6363
},
6464
{
@@ -84,7 +84,7 @@ test('Sends a navigation transaction to Sentry', async ({ page }) => {
8484
// there sould be at least 2 transactions: page load + navigation
8585
const recordedTransactionsHandle = await page.waitForFunction(() => {
8686
const hasTransactions = Array.isArray(window.recordedTransactions) && window.recordedTransactions.length >= 2;
87-
if (hasTransactions) return window.recordedTransactions
87+
if (hasTransactions) return window.recordedTransactions;
8888
});
8989
const eventIds = await recordedTransactionsHandle.jsonValue();
9090
if (!eventIds) throw new Error("Application didn't record any transaction event IDs.");
@@ -107,7 +107,7 @@ test('Sends a navigation transaction to Sentry', async ({ page }) => {
107107
if (e instanceof AxiosError && e.response) {
108108
const notThereJustYet = e instanceof AxiosError && e.response && e.response.status === 404;
109109
if (notThereJustYet) return 404;
110-
throw e
110+
throw e;
111111
}
112112
}
113113
},
@@ -155,4 +155,3 @@ test('Renders `sentry-trace` and `baggage` meta tags for a sub-route', async ({
155155
expect(sentryTraceMetaTag).toBeTruthy();
156156
expect(baggageMetaTag).toBeTruthy();
157157
});
158-

dev-packages/e2e-tests/test-applications/create-remix-app-fastify-vite/tests/behaviour-server.test.ts

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import path from 'node:path';
12
import { expect, test } from '@playwright/test';
23
import { AxiosError, axios } from './axios';
34
import { readEventsDir } from './utils';
4-
import path from "node:path";
55

66
const EVENT_POLLING_TIMEOUT = 90_000;
77

88
interface Tag {
9-
key: string,
10-
value: unknown,
9+
key: string;
10+
value: unknown;
1111
}
1212

1313
test('Sends two linked transactions (server & client) to Sentry', async ({ page }, testInfo) => {
@@ -18,7 +18,7 @@ test('Sends two linked transactions (server & client) to Sentry', async ({ page
1818

1919
const recordedTransactionsHandle = await page.waitForFunction(() => {
2020
const hasTransactions = Array.isArray(window.recordedTransactions) && window.recordedTransactions.length >= 1;
21-
if (hasTransactions) return window.recordedTransactions
21+
if (hasTransactions) return window.recordedTransactions;
2222
});
2323
const clientEventIds = await recordedTransactionsHandle.jsonValue();
2424
if (!clientEventIds) throw new Error("Application didn't record any transaction event IDs.");
@@ -35,7 +35,7 @@ test('Sends two linked transactions (server & client) to Sentry', async ({ page
3535
const { data: transactionEvent, status } = await axios.get(`/events/${eventId}/`);
3636
// Ref: https://docs.sentry.io/api/events/list-a-projects-error-events/
3737
const isFromThisTest = (transactionEvent.tags as Tag[]).find(({ key, value }) => {
38-
return key === "sentry_test" && value === testInfo.testId;
38+
return key === 'sentry_test' && value === testInfo.testId;
3939
});
4040
if (isFromThisTest) {
4141
const op = transactionEvent.contexts?.trace?.op;
@@ -45,7 +45,7 @@ test('Sends two linked transactions (server & client) to Sentry', async ({ page
4545
} catch (e) {
4646
const notThereJustYet = e instanceof AxiosError && e.response && e.response.status === 404;
4747
if (notThereJustYet) return 404;
48-
throw e
48+
throw e;
4949
}
5050
},
5151
{
@@ -58,14 +58,16 @@ test('Sends two linked transactions (server & client) to Sentry', async ({ page
5858
expect(pageLoadTransactionEvent).not.toBeNull();
5959

6060
let serverEventIds = null;
61-
await expect.poll(async () => {
62-
const files = await readEventsDir();
63-
if (files.length !== 0) {
64-
serverEventIds = files.map(f => path.basename(f, ".txt"));
65-
return true;
66-
}
67-
return false;
68-
}).toBe(true)
61+
await expect
62+
.poll(async () => {
63+
const files = await readEventsDir();
64+
if (files.length !== 0) {
65+
serverEventIds = files.map(f => path.basename(f, '.txt'));
66+
return true;
67+
}
68+
return false;
69+
})
70+
.toBe(true);
6971
expect(serverEventIds).not.toBeNull();
7072

7173
console.log(`Polling for server-side eventIds: ${JSON.stringify(serverEventIds)}`);
@@ -84,7 +86,7 @@ test('Sends two linked transactions (server & client) to Sentry', async ({ page
8486
const { data: transactionEvent, status } = await axios.get(`/events/${eventId}/`);
8587
// Ref: https://docs.sentry.io/api/events/list-a-projects-error-events/
8688
const isFromThisTest = (transactionEvent.tags as Tag[]).find(({ key, value }) => {
87-
return key === "sentry_test" && value === testInfo.testId;
89+
return key === 'sentry_test' && value === testInfo.testId;
8890
});
8991
if (isFromThisTest) {
9092
const op = transactionEvent.contexts?.trace?.op;
@@ -94,7 +96,7 @@ test('Sends two linked transactions (server & client) to Sentry', async ({ page
9496
} catch (e) {
9597
const notThereJustYet = e instanceof AxiosError && e.response && e.response.status === 404;
9698
if (notThereJustYet) return 404;
97-
throw e
99+
throw e;
98100
}
99101
},
100102
{
@@ -108,8 +110,8 @@ test('Sends two linked transactions (server & client) to Sentry', async ({ page
108110
expect(httpServerTransactionEvent).not.toBeNull();
109111

110112
// the two events are both related to `routes/_index` page ...
111-
const httpServerTransactionTag = (httpServerTransactionEvent!.tags as Tag[]).find(({ key }) => key === "transaction");
112-
const pageLoadTransactionTag = (pageLoadTransactionEvent!.tags as Tag[]).find(({ key }) => key === "transaction");
113+
const httpServerTransactionTag = (httpServerTransactionEvent!.tags as Tag[]).find(({ key }) => key === 'transaction');
114+
const pageLoadTransactionTag = (pageLoadTransactionEvent!.tags as Tag[]).find(({ key }) => key === 'transaction');
113115
expect(httpServerTransactionTag!.value).toBe('routes/_index');
114116
expect(pageLoadTransactionTag!.value).toBe('routes/_index');
115117

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { test as setup } from "@playwright/test";
2-
import { recreateEventsDir } from "./utils";
1+
import { test as setup } from '@playwright/test';
2+
import { recreateEventsDir } from './utils';
33

4-
setup("remove left-overs from #tests/events directory", async () => {
4+
setup('remove left-overs from #tests/events directory', async () => {
55
// We are not cleaning up after the testrun by design:
66
// we are leaving the events from the test behind to be able
77
// to inspect them.
88
await recreateEventsDir();
9-
})
9+
});

0 commit comments

Comments
 (0)