-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(xsnap): Verify npm install build process
- Loading branch information
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
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(); | ||
}); |
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