Skip to content

Commit b2397e4

Browse files
committed
linting
1 parent 53c9ef3 commit b2397e4

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

test/index.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ await describe('windows-unc-path-connect', async () => {
3030
});
3131
await describe('windows-unc-path-connect/validators', async () => {
3232
const goodUncPaths = ['\\\\192.168.1.1\\folder'];
33+
const badUncPaths = [
34+
'192.168.1.1',
35+
'\\192.168.1.1',
36+
'\\\\192.168.1.1\\folder" /delete'
37+
];
3338
await describe('uncPathIsSafe()', async () => {
3439
await it('Returns "true" for good UNC paths', () => {
3540
for (const goodUncPath of goodUncPaths) {
3641
assert.strictEqual(uncPathIsSafe(goodUncPath), true);
3742
}
3843
});
3944
await it('Returns "false" for bad UNC paths', () => {
40-
const badUncPaths = [
41-
'192.168.1.1',
42-
'\\192.168.1.1',
43-
'\\\\192.168.1.1\\folder" /delete'
44-
];
4545
for (const badUncPath of badUncPaths) {
4646
assert.strictEqual(uncPathIsSafe(badUncPath), false);
4747
assert.strictEqual(uncPathOptionsAreSafe({

test/index.test.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ await describe('windows-unc-path-connect', async () => {
5252
await describe('windows-unc-path-connect/validators', async () => {
5353
const goodUncPaths: UncPath[] = ['\\\\192.168.1.1\\folder']
5454

55+
const badUncPaths = [
56+
// eslint-disable-next-line sonarjs/no-hardcoded-ip
57+
'192.168.1.1', // missing slashes
58+
'\\192.168.1.1', // missing double slash beginning
59+
'\\\\192.168.1.1\\folder" /delete' // includes double quote
60+
]
61+
5562
await describe('uncPathIsSafe()', async () => {
5663
await it('Returns "true" for good UNC paths', () => {
5764
for (const goodUncPath of goodUncPaths) {
@@ -60,15 +67,10 @@ await describe('windows-unc-path-connect/validators', async () => {
6067
})
6168

6269
await it('Returns "false" for bad UNC paths', () => {
63-
const badUncPaths = [
64-
// eslint-disable-next-line sonarjs/no-hardcoded-ip
65-
'192.168.1.1', // missing slashes
66-
'\\192.168.1.1', // missing double slash beginning
67-
'\\\\192.168.1.1\\folder" /delete' // includes double quote
68-
]
6970

7071
for (const badUncPath of badUncPaths) {
7172
assert.strictEqual(uncPathIsSafe(badUncPath), false)
73+
7274
assert.strictEqual(
7375
uncPathOptionsAreSafe({
7476
uncPath: badUncPath

0 commit comments

Comments
 (0)