mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: add test for npm package installing correctly (#5714)
* chore: add test for npm package installing correctly This command packs up the module and installs it again to check we're correctly bundling everything we need to allow users to do a fresh install. * install realpath
This commit is contained in:
15
scripts/test-install.sh
Executable file
15
scripts/test-install.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env sh
|
||||
set -e
|
||||
|
||||
# Pack the module into a tarball
|
||||
npm pack
|
||||
tarball="$(realpath puppeteer-*.tgz)"
|
||||
cd "$(mktemp -d)"
|
||||
# Check we can install from the tarball.
|
||||
# This emulates installing from npm and ensures that:
|
||||
# 1. we publish the right files in the `files` list from package.json
|
||||
# 2. The install script works and correctly exits without errors
|
||||
# 3. Requiring Puppeteer from Node works.
|
||||
npm install --loglevel silent "${tarball}"
|
||||
node --eval="require('puppeteer')"
|
||||
rm "${tarball}"
|
||||
Reference in New Issue
Block a user