Skip to content

Commit c1ef654

Browse files
committed
test: reduce to 1 worker in CI + preload fonts
1 parent 2bc0d15 commit c1ef654

File tree

7 files changed

+38
-3
lines changed

7 files changed

+38
-3
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"share-files": "node scripts/share_files.js",
1616
"new-template": "node scripts/new_template.js",
1717
"husky": "husky install",
18-
"test:desktop:templates": "PLAYWRIGHT_HTML_REPORT=playwright-report-desktop npx playwright test --project chromium_desktop --workers=2",
19-
"test:mobile:templates": "PLAYWRIGHT_HTML_REPORT=playwright-report-mobile npx playwright test --project safari_mobile --workers=2"
18+
"test:desktop:templates": "PLAYWRIGHT_HTML_REPORT=playwright-report-desktop npx playwright test --project chromium_desktop",
19+
"test:mobile:templates": "PLAYWRIGHT_HTML_REPORT=playwright-report-mobile npx playwright test --project safari_mobile"
2020
},
2121
"dependencies": {
2222
"chalk": "^5.4.1",

packages/base/pages/_document.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ export default function CreateNextjsDappDocument() {
44
return (
55
<Html lang='en'>
66
<Head>
7+
<link
8+
rel='preload'
9+
href='https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap'
10+
as='style'
11+
/>
12+
713
<link href='https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap' rel='stylesheet' />
814
<meta name='application-name' content='Create NextJs Dapp' />
915
<meta name='mobile-web-app-capable' content='yes' />

packages/example/pages/_document.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ export default function CreateNextjsDappDocument() {
44
return (
55
<Html lang='en'>
66
<Head>
7+
<link
8+
rel='preload'
9+
href='https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap'
10+
as='style'
11+
/>
12+
713
<link href='https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap' rel='stylesheet' />
814
<meta name='application-name' content='Create NextJs Dapp' />
915
<meta name='mobile-web-app-capable' content='yes' />

packages/styled-components/pages/_document.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ export default function CreateNextjsDappDocument() {
55
return (
66
<Html lang='en'>
77
<Head>
8+
<link
9+
rel='preload'
10+
href='https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap'
11+
as='style'
12+
/>
13+
814
<link href='https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap' rel='stylesheet' />
915
<meta name='application-name' content='Create NextJs Dapp' />
1016
<meta name='mobile-web-app-capable' content='yes' />

packages/stylex/app/layout.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ export default function RootLayout({ children }: { children: React.ReactNode })
3232
return (
3333
<html {...stylex.props(styles.html)} lang='en'>
3434
<head>
35+
<link
36+
rel='preload'
37+
href='https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap'
38+
as='style'
39+
/>
40+
3541
{/* we can't use next/font as it requires SWC which is replaced by necessary babel config */}
3642
<link href='https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap' rel='stylesheet' />
3743
</head>

packages/tailwind/pages/_document.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ export default function CreateNextjsDappDocument() {
44
return (
55
<Html lang='en'>
66
<Head>
7+
<link
8+
rel='preload'
9+
href='https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap'
10+
as='style'
11+
/>
12+
713
<link href='https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap' rel='stylesheet' />
814
<meta name='application-name' content='Create NextJs Dapp' />
915
<meta name='mobile-web-app-capable' content='yes' />

playwright.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import { defineConfig, devices } from '@playwright/test';
2+
import dotenv from 'dotenv';
3+
4+
dotenv.config({ path: '.env', override: true });
5+
6+
const isCIEnv = !!process.env.CI;
27

38
export default defineConfig({
49
testDir: './tests',
510
snapshotDir: './tests/snapshots',
6-
workers: 2,
11+
workers: isCIEnv ? 1 : 5,
712
retries: 2,
813
reporter: [
914
['list', {}],

0 commit comments

Comments
 (0)