Skip to content

Commit 074d8f4

Browse files
committed
chore: update @epic-web/workshop-app
1 parent 2800795 commit 074d8f4

File tree

44 files changed

+218
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+218
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ workspace/
55
**/build/
66
**/public/build
77
**/playwright-report
8+
**/test-results
89
data.db
910
/playground
1011
**/tsconfig.tsbuildinfo

epicshop/.diffignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*.webp
2+
tests/

epicshop/package-lock.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

epicshop/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"type": "module",
33
"dependencies": {
4-
"@epic-web/workshop-app": "^4.26.1"
4+
"@epic-web/workshop-app": "^4.26.1",
5+
"execa": "^9.3.1"
56
}
67
}

epicshop/setup-custom.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
isProblemApp,
55
setPlayground,
66
} from '@epic-web/workshop-utils/apps.server'
7+
import { $ } from 'execa'
78
import fsExtra from 'fs-extra'
89

910
const allApps = await getApps()
@@ -29,3 +30,16 @@ if (!process.env.SKIP_PLAYGROUND) {
2930
)
3031
}
3132
}
33+
34+
if (!process.env.SKIP_PLAYWRIGHT) {
35+
console.log(
36+
'🎭 installing playwright for testing... This may require sudo (or admin) privileges and may ask for your password. It will also take some time depending on whether you installed recently or have a slower network connection... Thanks for your patience!',
37+
)
38+
try {
39+
await $`npx playwright install chromium --with-deps`
40+
console.log('✅ playwright installed')
41+
} catch (error) {
42+
console.error('❌ playwright install failed:', error.message)
43+
throw error
44+
}
45+
}

exercises/01.init/01.problem.static/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
"description": "Super simple implementation of RSCs with minimal deps",
77
"main": "index.js",
88
"scripts": {
9-
"dev": "node --watch server/app.js"
9+
"dev": "node --watch server/app.js",
10+
"test": "playwright test --config=./tests/playwright.config.js"
1011
},
1112
"keywords": [],
1213
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
1314
"license": "MIT",
1415
"dependencies": {
1516
"@hono/node-server": "^1.11.1",
17+
"@playwright/test": "^1.47.1",
1618
"close-with-grace": "^1.3.0",
1719
"hono": "^4.3.7",
1820
"react": "19.0.0-beta-94eed63c49-20240425",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { defineConfig, devices } from '@playwright/test'
2+
3+
const PORT = process.env.PORT || '3000'
4+
5+
export default defineConfig({
6+
reporter: [['html', { open: 'never' }]],
7+
use: {
8+
baseURL: `http://localhost:${PORT}/`,
9+
trace: 'retain-on-failure',
10+
},
11+
12+
projects: [
13+
{
14+
name: 'chromium',
15+
use: { ...devices['Desktop Chrome'] },
16+
},
17+
],
18+
19+
webServer: {
20+
command: process.env.CI ? 'npm run start' : 'npm run dev',
21+
port: Number(PORT),
22+
reuseExistingServer: !process.env.CI,
23+
stdout: 'pipe',
24+
stderr: 'pipe',
25+
env: { PORT },
26+
},
27+
})
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { test, expect } from '@playwright/test'
2+
3+
test('should display the home page', async ({ page }) => {
4+
await page.goto('/')
5+
await expect(page).toHaveTitle('Starship Deets')
6+
})

exercises/01.init/01.solution.static/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
"description": "Super simple implementation of RSCs with minimal deps",
77
"main": "index.js",
88
"scripts": {
9-
"dev": "node --watch server/app.js"
9+
"dev": "node --watch server/app.js",
10+
"test": "playwright test --config=./tests/playwright.config.js"
1011
},
1112
"keywords": [],
1213
"author": "Kent C. Dodds <[email protected]> (https://kentcdodds.com/)",
1314
"license": "MIT",
1415
"dependencies": {
1516
"@hono/node-server": "^1.11.1",
17+
"@playwright/test": "^1.47.1",
1618
"close-with-grace": "^1.3.0",
1719
"hono": "^4.3.7",
1820
"react": "19.0.0-beta-94eed63c49-20240425",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { defineConfig, devices } from '@playwright/test'
2+
3+
const PORT = process.env.PORT || '3000'
4+
5+
export default defineConfig({
6+
reporter: [['html', { open: 'never' }]],
7+
use: {
8+
baseURL: `http://localhost:${PORT}/`,
9+
trace: 'retain-on-failure',
10+
},
11+
12+
projects: [
13+
{
14+
name: 'chromium',
15+
use: { ...devices['Desktop Chrome'] },
16+
},
17+
],
18+
19+
webServer: {
20+
command: process.env.CI ? 'npm run start' : 'npm run dev',
21+
port: Number(PORT),
22+
reuseExistingServer: !process.env.CI,
23+
stdout: 'pipe',
24+
stderr: 'pipe',
25+
env: { PORT },
26+
},
27+
})

0 commit comments

Comments
 (0)