Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: ensure npm version is not release candidate
v11.6.0 ended up shipping with an npm version `6.5.0-next.0`.
This test should avoid it happening in the future.
  • Loading branch information
MylesBorins committed Jan 16, 2019
commit 134a8c548dfa708c23acef11aee984c5ee5a58d0
18 changes: 18 additions & 0 deletions test/parallel/test-npm-version.js
Original file line number Diff line number Diff line change
@@ -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+$/),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert(pkg.version.match(/^\d+\.\d+\.\d+$/),
assert.ok(/^\d+.\d+.\d+$/.test(pkg.version.match),

`unexpected version number: ${pkg.version}`);