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 3, 2025
1 parent 221a4b4 commit a0c13da
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 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": "^7.2.0"
},
"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 { $ } 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 $`npm pack --json`;
const [{ filename }] = JSON.parse(npmout);
await $({ cwd: tmp })`tar xvf ${resolve(filename)}`;
await $({ cwd: join(tmp, 'package') })`npm install`;
t.pass();
});
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6291,7 +6291,7 @@ execa@^5.0.0:
signal-exit "^3.0.3"
strip-final-newline "^2.0.0"

execa@^7.1.1:
execa@^7.1.1, execa@^7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-7.2.0.tgz#657e75ba984f42a70f38928cedc87d6f2d4fe4e9"
integrity sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==
Expand Down

0 comments on commit a0c13da

Please sign in to comment.