From b8d780c0ee54fd4032c354a05050ae4f4d1163d9 Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Wed, 16 Jan 2019 13:32:01 -0500 Subject: [PATCH] test: ensure npm version is not release candidate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v11.6.0 ended up shipping with an npm version `6.5.0-next.0`. This test should avoid it happening in the future. PR-URL: https://github.com/nodejs/node/pull/25538 Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell Reviewed-By: Minwoo Jung --- test/parallel/test-npm-version.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/parallel/test-npm-version.js diff --git a/test/parallel/test-npm-version.js b/test/parallel/test-npm-version.js new file mode 100644 index 00000000000000..aa4bb77ac8a44f --- /dev/null +++ b/test/parallel/test-npm-version.js @@ -0,0 +1,18 @@ +'use strict'; +require('../common'); + +const path = require('path'); +const assert = require('assert'); + +const npmPathPackageJson = path.resolve( + __dirname, + '..', + '..', + 'deps', + 'npm', + 'package.json' +); + +const pkg = require(npmPathPackageJson); +assert(pkg.version.match(/^\d+\.\d+\.\d+$/), + `unexpected version number: ${pkg.version}`);