Skip to content

Commit 981dff3

Browse files
asdf
1 parent d5a8dd9 commit 981dff3

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

packages/bson-bench/src/common.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class Package {
6767
* Note that this function should not be run in the same Node process that imports the installed
6868
* module
6969
**/
70-
async install(): Promise<void> {
70+
async install(inheritOutput = false): Promise<void> {
7171
console.error('installing');
7272
let source: string;
7373
switch (this.type) {
@@ -98,9 +98,12 @@ export class Package {
9898
{ encoding: 'utf8', cwd: __dirname }
9999
);
100100

101-
npmInstallProcess.stderr?.pipe(process.stderr);
102-
npmInstallProcess.stdout?.pipe(process.stdout);
101+
inheritOutput && npmInstallProcess.stderr?.pipe(process.stderr);
102+
inheritOutput && npmInstallProcess.stdout?.pipe(process.stdout);
103+
inheritOutput && npmInstallProcess.on('error', (e) => console.error({e }));
103104
const exitCode: number = (await once(npmInstallProcess, 'exit'))[0];
105+
inheritOutput && console.error({ exitCode });
106+
104107
if (exitCode !== 0) {
105108
throw new Error(`unable to install module: ${this.computedModuleName}@${source}`);
106109
}

packages/bson-bench/test/unit/common.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ describe.only('common functionality', function () {
113113
}
114114
);
115115

116-
context.only(
116+
context(
117117
'when given a correctly formatted git package using git tag that exists',
118118
function () {
119119
it('installs successfully', async function () {
120120
const bson6Git = new Package('bson#v6.0.0');
121-
const maybeError = await bson6Git.install().catch(error => error);
121+
const maybeError = await bson6Git.install(true).catch(error => error);
122122
expect(maybeError).to.be.undefined;
123123
});
124124
}

0 commit comments

Comments
 (0)