Skip to content

Commit 1de65f1

Browse files
committed
increase coverage
1 parent eb91ba7 commit 1de65f1

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

test/index.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import assert from 'node:assert';
22
import fs from 'node:fs/promises';
33
import { describe, it } from 'node:test';
44
import { connectToUncPath, disconnectUncPath } from '../index.js';
5-
import { uncPathIsSafe, uncPathOptionsHaveCredentials } from '../validators.js';
5+
import { uncPathIsSafe, uncPathOptionsAreSafe, uncPathOptionsHaveCredentials } from '../validators.js';
66
import { validUncPathOptions } from './config/config.js';
77
await describe('windows-unc-path-connect', async () => {
88
for (const path of validUncPathOptions) {
@@ -44,6 +44,9 @@ await describe('windows-unc-path-connect/validators', async () => {
4444
];
4545
for (const badUncPath of badUncPaths) {
4646
assert.strictEqual(uncPathIsSafe(badUncPath), false);
47+
assert.strictEqual(uncPathOptionsAreSafe({
48+
uncPath: badUncPath
49+
}), false);
4750
}
4851
});
4952
});

test/index.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ import {
1111
connectToUncPath,
1212
disconnectUncPath
1313
} from '../index.js'
14-
import { uncPathIsSafe, uncPathOptionsHaveCredentials } from '../validators.js'
14+
import {
15+
uncPathIsSafe,
16+
uncPathOptionsAreSafe,
17+
uncPathOptionsHaveCredentials
18+
} from '../validators.js'
1519

1620
import { validUncPathOptions } from './config/config.js'
1721

@@ -46,7 +50,6 @@ await describe('windows-unc-path-connect', async () => {
4650
})
4751

4852
await describe('windows-unc-path-connect/validators', async () => {
49-
5053
const goodUncPaths: UncPath[] = ['\\\\192.168.1.1\\folder']
5154

5255
await describe('uncPathIsSafe()', async () => {
@@ -66,6 +69,12 @@ await describe('windows-unc-path-connect/validators', async () => {
6669

6770
for (const badUncPath of badUncPaths) {
6871
assert.strictEqual(uncPathIsSafe(badUncPath), false)
72+
assert.strictEqual(
73+
uncPathOptionsAreSafe({
74+
uncPath: badUncPath
75+
}),
76+
false
77+
)
6978
}
7079
})
7180
})

0 commit comments

Comments
 (0)