Skip to content

Commit

Permalink
test(xsnap): Verify npm install build process
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Mar 1, 2025
1 parent 545fc58 commit fe9d407
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/xsnap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"test:xs": "exit 0"
},
"dependencies": {
"@endo/errors": "^1.2.9",
"@agoric/internal": "^0.3.2",
"@agoric/xsnap-lockdown": "^0.14.0",
"@endo/bundle-source": "^3.5.1",
"@endo/errors": "^1.2.9",
"@endo/eventual-send": "^1.3.0",
"@endo/init": "^1.1.8",
"@endo/netstring": "^1.0.14",
Expand All @@ -46,7 +46,8 @@
"@endo/nat": "^5.0.14",
"@types/glob": "^8.1.0",
"ava": "^5.3.0",
"c8": "^10.1.2"
"c8": "^10.1.2",
"execa": "^9.5.2"
},
"files": [
"LICENSE*",
Expand Down
20 changes: 20 additions & 0 deletions packages/xsnap/test/install.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// building xsnap locally and installing from npm follow different paths
// through build.js, since installation targets are not obliged to have a git
// toolchain.
// This test verifies the post-publish experience.

import { mkdtemp, rm } from 'node:fs/promises';
import { join, resolve } from 'node:path';
import { tmpdir } from 'node:os';
import { execa } from 'execa';
import test from 'ava';

test('pack and install xsnap', async t => {
const tmp = await mkdtemp(join(tmpdir(), 'xsnap-'));
t.teardown(() => rm(tmp, { recursive: true }));
const { stdout: npmout } = await execa`npm pack --json`;
const [{ filename }] = JSON.parse(npmout);
await execa({ cwd: tmp })`tar xvf ${resolve(filename)}`;
await execa({ cwd: join(tmp, 'package') })`npm install`;
t.pass();
});
36 changes: 36 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6306,6 +6306,24 @@ execa@^7.1.1:
signal-exit "^3.0.7"
strip-final-newline "^3.0.0"

execa@^9.5.2:
version "9.5.2"
resolved "https://registry.yarnpkg.com/execa/-/execa-9.5.2.tgz#a4551034ee0795e241025d2f987dab3f4242dff2"
integrity sha512-EHlpxMCpHWSAh1dgS6bVeoLAXGnJNdR93aabr4QCGbzOM73o5XmRfM/e5FUqsw3aagP8S8XEWUWFAxnRBnAF0Q==
dependencies:
"@sindresorhus/merge-streams" "^4.0.0"
cross-spawn "^7.0.3"
figures "^6.1.0"
get-stream "^9.0.0"
human-signals "^8.0.0"
is-plain-obj "^4.1.0"
is-stream "^4.0.1"
npm-run-path "^6.0.0"
pretty-ms "^9.0.0"
signal-exit "^4.1.0"
strip-final-newline "^4.0.0"
yoctocolors "^2.0.0"

expand-template@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c"
Expand Down Expand Up @@ -7277,6 +7295,11 @@ human-signals@^7.0.0:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-7.0.0.tgz#93e58e0c19cfec1dded4af10cd4969f5ab75f6c8"
integrity sha512-74kytxOUSvNbjrT9KisAbaTZ/eJwD/LrbM/kh5j0IhPuJzwuA19dWvniFGwBzN9rVjg+O/e+F310PjObDXS+9Q==

human-signals@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-8.0.0.tgz#2d3d63481c7c2319f0373428b01ffe30da6df852"
integrity sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==

humanize-ms@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed"
Expand Down Expand Up @@ -9505,6 +9528,14 @@ npm-run-path@^5.1.0, npm-run-path@^5.2.0:
dependencies:
path-key "^4.0.0"

npm-run-path@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-6.0.0.tgz#25cfdc4eae04976f3349c0b1afc089052c362537"
integrity sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==
dependencies:
path-key "^4.0.0"
unicorn-magic "^0.3.0"

npmlog@^6.0.0, npmlog@^6.0.2:
version "6.0.2"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-6.0.2.tgz#c8166017a42f2dea92d6453168dd865186a70830"
Expand Down Expand Up @@ -12090,6 +12121,11 @@ unicode-property-aliases-ecmascript@^2.0.0:
resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd"
integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==

unicorn-magic@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/unicorn-magic/-/unicorn-magic-0.3.0.tgz#4efd45c85a69e0dd576d25532fbfa22aa5c8a104"
integrity sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==

unique-filename@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-2.0.1.tgz#e785f8675a9a7589e0ac77e0b5c34d2eaeac6da2"
Expand Down

0 comments on commit fe9d407

Please sign in to comment.