Skip to content

Commit 57e8f5f

Browse files
committed
Merge branch 'feat/ip-utils' into chore/all-my-stuffs
# Conflicts: # package.json # src/utils/ip.test.ts
2 parents 3294c36 + 3550d81 commit 57e8f5f

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

pnpm-lock.yaml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/ip.test.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// removed test because of SonarQube false positives, but all test pass
2-
import { describe, expect, it } from 'vitest';
3-
4-
describe('parseAsCIDR', () => {
5-
it('returns cidr', () => {
6-
expect(true).to.eql(true);
7-
});
8-
});
9-
10-
/*
111
import { describe, expect, it } from 'vitest';
122
import { getIPNetworkType, getNetworksCount, getSubnets, parseAsCIDR, to6to4Prefix, toARPA, toIPv4MappedAddress, toIPv4MappedAddressDecimal } from './ip';
133

@@ -16,18 +6,18 @@ describe('ipv4/6 util', () => {
166
it('returns cidr', () => {
177
expect(parseAsCIDR('1.1.1.1/6')).to.eql('1.1.1.1/6');
188
expect(parseAsCIDR('172.16.2.2/16')).to.eql('172.16.2.2/16');
19-
expect(parseAsCIDR('1a:b:c::d:e:f/ffff:ffff:f4ff:ffff:ffff:ff5f:ffff:ff00')).to.eql(undefined);
9+
expect(parseAsCIDR('1a:b:c::d:e:f/ffff:ffff:f4ff:ffff:ffff:ff5f:ffff:ff00')).to.eql();
2010
expect(parseAsCIDR('10.1.2.3/255.255.255.252')).to.eql('10.1.2.0/30');
21-
expect(parseAsCIDR('10.*.0.*')).to.eql(undefined);
11+
expect(parseAsCIDR('10.*.0.*')).to.eql();
2212
expect(parseAsCIDR('10.1.0.*')).to.eql('10.1.0.0/24');
2313
expect(parseAsCIDR('10.2.*.*')).to.eql('10.2.0.0/16');
2414
expect(parseAsCIDR('a:b:0:8000::/ffff:ffff:ffff:8000::')).to.eql('a:b:0:8000::/49');
2515
expect(parseAsCIDR('::/::')).to.eql('::/0');
2616
expect(parseAsCIDR('10.20.30.64-10.20.30.127')).to.eql('10.20.30.64/26');
27-
expect(parseAsCIDR('10.0.128.0/255.0.128.0')).to.eql(undefined);
17+
expect(parseAsCIDR('10.0.128.0/255.0.128.0')).to.eql();
2818
expect(parseAsCIDR('a::bc:1234/128')).to.eql('a::bc:1234/128');
2919
expect(parseAsCIDR('a::bc:ff00-a::bc:ff0f')).to.eql('a::bc:ff00/124');
30-
expect(parseAsCIDR('10.0.1.1/255.255.1.0')).to.eql(undefined);
20+
expect(parseAsCIDR('10.0.1.1/255.255.1.0')).to.eql();
3121
expect(parseAsCIDR('10.0.0.0/255.255.0.0')).to.eql('10.0.0.0/16');
3222
});
3323
});
@@ -240,4 +230,3 @@ describe('ipv4/6 util', () => {
240230
});
241231
});
242232
});
243-
*/

0 commit comments

Comments
 (0)