xref: /third_party/node/test/parallel/test-release-npm.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst common = require('../common');
41cb0ef41Sopenharmony_ciconst assert = require('assert');
51cb0ef41Sopenharmony_ciconst child_process = require('child_process');
61cb0ef41Sopenharmony_ciconst path = require('path');
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciconst releaseReg = /^v\d+\.\d+\.\d+$/;
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ci// Npm requires crypto support.
111cb0ef41Sopenharmony_ciif (!releaseReg.test(process.version) || !common.hasCrypto) {
121cb0ef41Sopenharmony_ci  common.skip('This test is only for release builds');
131cb0ef41Sopenharmony_ci}
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ci{
161cb0ef41Sopenharmony_ci  // Verify that npm does not print out a warning when executed.
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_ci  const npmCli = path.join(__dirname, '../../deps/npm/bin/npm-cli.js');
191cb0ef41Sopenharmony_ci  const npmExec = child_process.spawnSync(process.execPath, [npmCli]);
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ci  const stderr = npmExec.stderr.toString();
221cb0ef41Sopenharmony_ci  assert.strictEqual(stderr.length, 0, 'npm is not ready for this release ' +
231cb0ef41Sopenharmony_ci                     'and is going to print warnings to users:\n' + stderr);
241cb0ef41Sopenharmony_ci}
25

Indexes created Thu Nov 07 10:32:03 CST 2024