Skip to content

Commit 43d100b

Browse files
committed
chore: use sirv-cli within "puppeteer" example
1 parent 6169070 commit 43d100b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

examples/puppeteer/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"private": true,
33
"type": "module",
44
"scripts": {
5-
"dev": "vite",
5+
"start": "sirv src --dev",
66
"test": "uvu tests -i setup"
77
},
88
"devDependencies": {
99
"puppeteer": "^5.5.0",
10-
"uvu": "^0.5.0",
11-
"vite": "1.0.0-rc.13"
10+
"sirv-cli": "^1.0.6",
11+
"uvu": "^0.5.0"
1212
}
1313
}

examples/puppeteer/readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This example runs [Puppeteer](https://www.npmjs.com/package/puppeteer) programmatically.
44

5-
In order to invoke and test against source (`/src`) files, this example also uses [`vite`](https://www.npmjs.com/package/vite) to run a local devserver. Puppeteer connects to this devserver to access the `window` globals that `src/math.js` and `src/utils.js` are globally mounted to.
5+
In order to invoke and test against source (`/src`) files, this example also uses [`sirv-cli`](https://www.npmjs.com/package/sirv-cli) to run a local file server. Puppeteer connects to this file server to access the `window` globals that `src/math.js` and `src/utils.js` are globally mounted to.
66

77
> **Note:** Window globals are not required in order for `uvu` to work with `puppeteer`! <br>You may, for example, load your Preact, Svelte, Vue, ... etc application inside the devserver & interact with it through Puppeteer APIs!
88
@@ -15,8 +15,8 @@ $ npm install
1515
## Testing
1616

1717
```sh
18-
# start devserver
19-
$ npm run dev
18+
# start server
19+
$ npm start
2020

2121
# run tests (2nd terminal)
2222
$ npm test

examples/puppeteer/index.html examples/puppeteer/src/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<title>uvu + Puppeteer</title>
77
</head>
88
<body>
9-
<script type="module" src="/src/app.js"></script>
9+
<script type="module" src="/app.js"></script>
1010
</body>
1111
</html>

examples/puppeteer/tests/setup/puppeteer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ export async function reset(context) {
1515

1616
// Navigate to homepage
1717
export async function homepage(context) {
18-
await context.page.goto('http://localhost:3000');
18+
await context.page.goto('http://localhost:5000');
1919
}

0 commit comments

Comments
 (0)