Skip to content

Commit f744999

Browse files
committed
feat: integrate biomejs for type check, format, lint
1 parent 577c6ca commit f744999

File tree

6 files changed

+608
-465
lines changed

6 files changed

+608
-465
lines changed

packages/tests-e2e/biome.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"linter": {
7+
"enabled": true,
8+
"rules": {
9+
"recommended": true
10+
}
11+
},
12+
"formatter": {
13+
"indentStyle": "space",
14+
"indentWidth": 4
15+
}
16+
}

packages/tests-e2e/package.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
2-
"name": "tests-e2e",
3-
"version": "1.0.0",
4-
"main": "index.js",
5-
"license": "MIT",
6-
"devDependencies": {
7-
"@playwright/test": "^1.44.0",
8-
"@types/node": "^20.12.12"
9-
},
10-
"scripts": {},
11-
"dependencies": {
12-
"dotenv": "^16.4.5"
13-
}
2+
"name": "tests-e2e",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"license": "MIT",
6+
"devDependencies": {
7+
"@playwright/test": "^1.44.0",
8+
"@types/node": "^20.12.12"
9+
},
10+
"scripts": {
11+
"biome:check": "biome check --apply ./tests/*"
12+
}
1413
}
Lines changed: 71 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { defineConfig, devices } from '@playwright/test';
2-
import 'dotenv/config';
1+
import { defineConfig, devices } from "@playwright/test";
2+
import "dotenv/config";
33

44
/**
55
* Read environment variables from file.
@@ -11,78 +11,80 @@ import 'dotenv/config';
1111
* See https://playwright.dev/docs/test-configuration.
1212
*/
1313
export default defineConfig({
14-
testDir: './tests',
15-
/* Run tests in files in parallel */
16-
fullyParallel: true,
17-
/* Fail the build on CI if you accidentally left test.only in the source code. */
18-
forbidOnly: !!process.env.CI,
19-
/* Retry on CI only */
20-
retries: process.env.CI ? 2 : 0,
21-
/* Opt out of parallel tests on CI. */
22-
workers: process.env.CI ? 1 : undefined,
23-
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
24-
reporter: 'html',
25-
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
26-
use: {
27-
/* Base URL to use in actions like `await page.goto('/')`. */
28-
baseURL: process.env.APP_BASE_URL,
29-
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
30-
trace: 'on-first-retry',
31-
},
32-
33-
/* Configure projects for major browsers */
34-
projects: process.env.CI ? [
35-
{
36-
name: 'chromium',
37-
use: { ...devices['Desktop Chrome'] },
14+
testDir: "./tests",
15+
/* Run tests in files in parallel */
16+
fullyParallel: true,
17+
/* Fail the build on CI if you accidentally left test.only in the source code. */
18+
forbidOnly: !!process.env.CI,
19+
/* Retry on CI only */
20+
retries: process.env.CI ? 2 : 0,
21+
/* Opt out of parallel tests on CI. */
22+
workers: process.env.CI ? 1 : undefined,
23+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
24+
reporter: "html",
25+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
26+
use: {
27+
/* Base URL to use in actions like `await page.goto('/')`. */
28+
baseURL: process.env.APP_BASE_URL,
29+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
30+
trace: "on-first-retry",
3831
},
3932

40-
{
41-
name: 'firefox',
42-
use: { ...devices['Desktop Firefox'] },
43-
},
33+
/* Configure projects for major browsers */
34+
projects: process.env.CI
35+
? [
36+
{
37+
name: "chromium",
38+
use: { ...devices["Desktop Chrome"] },
39+
},
4440

45-
{
46-
name: 'webkit',
47-
use: { ...devices['Desktop Safari'] },
48-
},
41+
{
42+
name: "firefox",
43+
use: { ...devices["Desktop Firefox"] },
44+
},
4945

50-
/* Test against mobile viewports. */
51-
// {
52-
// name: 'Mobile Chrome',
53-
// use: { ...devices['Pixel 5'] },
54-
// },
55-
// {
56-
// name: 'Mobile Safari',
57-
// use: { ...devices['iPhone 12'] },
58-
// },
46+
{
47+
name: "webkit",
48+
use: { ...devices["Desktop Safari"] },
49+
},
5950

60-
/* Test against branded browsers. */
61-
// {
62-
// name: 'Microsoft Edge',
63-
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
64-
// },
65-
// {
66-
// name: 'Google Chrome',
67-
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
68-
// },
69-
] : [
70-
// NOTE: WebKit is only supported on Debian and Ubuntu in Playwright.
71-
{
72-
name: 'chromium',
73-
use: { ...devices['Desktop Chrome'] },
74-
},
51+
/* Test against mobile viewports. */
52+
// {
53+
// name: 'Mobile Chrome',
54+
// use: { ...devices['Pixel 5'] },
55+
// },
56+
// {
57+
// name: 'Mobile Safari',
58+
// use: { ...devices['iPhone 12'] },
59+
// },
7560

76-
{
77-
name: 'firefox',
78-
use: { ...devices['Desktop Firefox'] },
79-
},
80-
],
61+
/* Test against branded browsers. */
62+
// {
63+
// name: 'Microsoft Edge',
64+
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
65+
// },
66+
// {
67+
// name: 'Google Chrome',
68+
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
69+
// },
70+
]
71+
: [
72+
// NOTE: WebKit is only supported on Debian and Ubuntu in Playwright.
73+
{
74+
name: "chromium",
75+
use: { ...devices["Desktop Chrome"] },
76+
},
8177

82-
/* Run your local dev server before starting the tests */
83-
// webServer: {
84-
// command: 'npm run start',
85-
// url: 'http://127.0.0.1:3000',
86-
// reuseExistingServer: !process.env.CI,
87-
// },
78+
{
79+
name: "firefox",
80+
use: { ...devices["Desktop Firefox"] },
81+
},
82+
],
83+
84+
/* Run your local dev server before starting the tests */
85+
// webServer: {
86+
// command: 'npm run start',
87+
// url: 'http://127.0.0.1:3000',
88+
// reuseExistingServer: !process.env.CI,
89+
// },
8890
});

0 commit comments

Comments
 (0)