Skip to content

Commit

Permalink
test: check version strings have expected pattern
Browse files Browse the repository at this point in the history
Many were checked, but a few were not.
  • Loading branch information
sam-github committed Oct 26, 2018
1 parent 482b56a commit f4225f0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/parallel/test-process-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,26 @@ assert(/^\d+\.\d+\.\d+(?:\.\d+)?-node\.\d+(?: \(candidate\))?$/
assert(/^\d+$/.test(process.versions.modules));

if (common.hasCrypto) {
// example: 1.1.0i
assert(/^\d+\.\d+\.\d+[a-z]?$/.test(process.versions.openssl));
}

// example: 3
assert(/^\d+$/.test(process.versions.napi));
// example: 1.34.0
assert(/^\d+\.\d+\.\d+$/.test(process.versions.nghttp2));

if (common.hasIntl) {
// example: 2018e
assert(/^\d{4}[a-z]$/.test(process.versions.tz));
// example: 33.1
assert(/^\d+\.\d+$/.test(process.versions.cldr));
// example: 62.1
assert(/^\d+\.\d+$/.test(process.versions.icu));
// example: 11.0
assert(/^\d+\.\d+$/.test(process.versions.unicode));
}

for (let i = 0; i < expected_keys.length; i++) {
const key = expected_keys[i];
const descriptor = Object.getOwnPropertyDescriptor(process.versions, key);
Expand Down

4 comments on commit f4225f0

@Trott
Copy link
Member

@Trott Trott commented on f4225f0 Oct 26, 2018

Choose a reason for hiding this comment

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

@sam-github This is missing metadata. Fix and force push with --force-with-lease?

@Trott
Copy link
Member

@Trott Trott commented on f4225f0 Oct 26, 2018

Choose a reason for hiding this comment

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

Was this pushed to Node.js core master by accident? Should we force push it out entirely?

@Trott
Copy link
Member

@Trott Trott commented on f4225f0 Oct 26, 2018

Choose a reason for hiding this comment

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

I force-pushed it out. (If it was supposed to be in Node.js core repo, you can re-land it with metadata.)

@sam-github
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used git node land to land it, which I expected to fill in the metadata. In retrospect, I am guessing this is because I selected "no" to the question "do you want to amend your commit"? I didn't have any intention of rewriting the commit message, it was good enough, so I said "no". Lesson learned, I'll reland.

/cc @joyeecheung

Please sign in to comment.