index: demos
To use a given basic-demo
as a template for a new myproject
:
$ npx degit pmndrs/examples/demos/basic-demo myproject
$ code myproject
$ npm ci
$ npm run dev
$ npm run build
Then npx serve out
.
$ npm test
To update the snapshots: npm test -- -- --update-snapshots
For generating reproductible snapshots, we use mcr.microsoft.com/playwright:v1.45.3-jammy
Docker image.
$ docker run -it --rm \
-w /app -v "$(pwd)":/app -v /app/node_modules \
mcr.microsoft.com/playwright:v1.45.3-jammy /bin/sh
#
# echo "Hey, I am acting like the CI"
#
# npm ci
# npm test
or in one command to update snapshots:
docker run --rm \
-w /app -v "$(pwd)":/app -v /app/node_modules \
mcr.microsoft.com/playwright:v1.45.3-jammy /bin/sh -c "npm ci && npm test -- -- --update-snapshots"