Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
1615c9c
commit feec588
Showing
3 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}" |