Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 00dab34

Browse filesBrowse files
committed
test: verify npm compatibility with releases
This adds a test that makes sure than running `npm` from a release does not print warnings to the console. PR-URL: #30082 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent ce49a41 commit 00dab34
Copy full SHA for 00dab34

File tree

Expand file treeCollapse file tree

1 file changed

+24
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+24
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-release-npm.js‎

Copy file name to clipboard
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const assert = require('assert');
5+
const child_process = require('child_process');
6+
const path = require('path');
7+
8+
const releaseReg = /^v\d+\.\d+\.\d+$/;
9+
10+
if (!releaseReg.test(process.version)) {
11+
common.skip('This test is only for release builds');
12+
}
13+
14+
{
15+
// Verify that npm does not print out a warning when executed
16+
17+
const npmCli = path.join(__dirname, '../../deps/npm/bin/npm-cli.js');
18+
const npmExec = child_process.spawnSync(process.execPath, [npmCli]);
19+
assert.strictEqual(npmExec.status, 1);
20+
21+
const stderr = npmExec.stderr.toString();
22+
assert.strictEqual(stderr.length, 0, 'npm is not ready for this release ' +
23+
'and is going to print warnings to users:\n' + stderr);
24+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.