Skip to content

Commit f24b154

Browse files
committed
fixup! tests for npm help
1 parent 25d2784 commit f24b154

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/lib/help.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const { test } = require('tap')
22
const requireInject = require('require-inject')
33
const { EventEmitter } = require('events')
4+
const path = require('path')
45

56
let npmUsageArg = null
67
const npmUsage = (arg) => {
@@ -210,7 +211,7 @@ test('npm help 1 install', t => {
210211
if (err)
211212
throw err
212213

213-
t.match(openUrlArg, /commands\/npm-install.html$/, 'attempts to open the correct url')
214+
t.match(openUrlArg, new RegExp(`commands${path.sep}npm-install.html$`), 'attempts to open the correct url')
214215
t.end()
215216
})
216217
})
@@ -233,7 +234,7 @@ test('npm help 5 install', t => {
233234
if (err)
234235
throw err
235236

236-
t.match(openUrlArg, /configuring-npm\/install.html$/, 'attempts to open the correct url')
237+
t.match(openUrlArg, new RegExp(`configuring-npm${path.sep}install.html$`), 'attempts to open the correct url')
237238
t.end()
238239
})
239240
})
@@ -255,7 +256,7 @@ test('npm help 7 config', t => {
255256
if (err)
256257
throw err
257258

258-
t.match(openUrlArg, /using-npm\/config.html$/, 'attempts to open the correct url')
259+
t.match(openUrlArg, new RegExp(`using-npm${path.sep}config.html$`), 'attempts to open the correct url')
259260
t.end()
260261
})
261262
})

0 commit comments

Comments
 (0)