Skip to content

Commit 86f5fc5

Browse files
authored
chore: remove code coverage bypass (#215)
We're at 100% now.
1 parent 5b5edc1 commit 86f5fc5

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

lib/npa.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ function isFileSpec (spec) {
6666
if (isWindows) {
6767
return isWindowsFile.test(spec)
6868
}
69-
// We never hit this in windows tests, obviously
70-
/* istanbul ignore next */
7169
return isPosixFile.test(spec)
7270
}
7371

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"node": "^20.17.0 || >=22.9.0"
4848
},
4949
"tap": {
50-
"branches": 97,
5150
"nyc-arg": [
5251
"--exclude",
5352
"tap-snapshots/**"

test/posix.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// redefine process.platform before any requires so that we don't cache a require that got the non-redefined value
2+
const { platform } = process
3+
Object.defineProperty(process, 'platform', { value: 'linux' })
4+
5+
const t = require('tap')
6+
const npa = require('..')
7+
8+
t.teardown(() => {
9+
Object.defineProperty(process, 'platform', { value: platform })
10+
})
11+
12+
// These are purely for coverage
13+
// We need tests that act like linux so that code paths are covered both ways when testing in windows itself.
14+
//
15+
t.test('file spec', t => {
16+
const actual = npa('./local')
17+
t.equal(actual.type, 'directory')
18+
t.equal(actual.raw, './local')
19+
t.end()
20+
})
21+
22+
t.test('encoded path', t => {
23+
const actual = npa('./path\\backslash')
24+
t.equal(actual.rawSpec, './path\\backslash')
25+
t.end()
26+
})

0 commit comments

Comments
 (0)