feec588f95
* 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
16 lines
490 B
Bash
Executable File
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}"
|