puppeteer/scripts/test-install.sh
Jack Franklin feec588f95
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
2020-04-22 15:33:36 +01:00

16 lines
490 B
Bash
Executable File

#!/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}"