From f24b154f6d7e799ac8d02801f839ba5b3f9ebf2c Mon Sep 17 00:00:00 2001 From: nlf Date: Mon, 14 Dec 2020 13:19:16 -0800 Subject: [PATCH] fixup! tests for npm help --- test/lib/help.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/lib/help.js b/test/lib/help.js index 1dfa794dc35b4..e490b7c9ad079 100644 --- a/test/lib/help.js +++ b/test/lib/help.js @@ -1,6 +1,7 @@ const { test } = require('tap') const requireInject = require('require-inject') const { EventEmitter } = require('events') +const path = require('path') let npmUsageArg = null const npmUsage = (arg) => { @@ -210,7 +211,7 @@ test('npm help 1 install', t => { if (err) throw err - t.match(openUrlArg, /commands\/npm-install.html$/, 'attempts to open the correct url') + t.match(openUrlArg, new RegExp(`commands${path.sep}npm-install.html$`), 'attempts to open the correct url') t.end() }) }) @@ -233,7 +234,7 @@ test('npm help 5 install', t => { if (err) throw err - t.match(openUrlArg, /configuring-npm\/install.html$/, 'attempts to open the correct url') + t.match(openUrlArg, new RegExp(`configuring-npm${path.sep}install.html$`), 'attempts to open the correct url') t.end() }) }) @@ -255,7 +256,7 @@ test('npm help 7 config', t => { if (err) throw err - t.match(openUrlArg, /using-npm\/config.html$/, 'attempts to open the correct url') + t.match(openUrlArg, new RegExp(`using-npm${path.sep}config.html$`), 'attempts to open the correct url') t.end() }) })