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
- /*
11
1
import { describe , expect , it } from 'vitest' ;
12
2
import { getIPNetworkType , getNetworksCount , getSubnets , parseAsCIDR , to6to4Prefix , toARPA , toIPv4MappedAddress , toIPv4MappedAddressDecimal } from './ip' ;
13
3
@@ -16,18 +6,18 @@ describe('ipv4/6 util', () => {
16
6
it ( 'returns cidr' , ( ) => {
17
7
expect ( parseAsCIDR ( '1.1.1.1/6' ) ) . to . eql ( '1.1.1.1/6' ) ;
18
8
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 ( ) ;
20
10
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 ( ) ;
22
12
expect ( parseAsCIDR ( '10.1.0.*' ) ) . to . eql ( '10.1.0.0/24' ) ;
23
13
expect ( parseAsCIDR ( '10.2.*.*' ) ) . to . eql ( '10.2.0.0/16' ) ;
24
14
expect ( parseAsCIDR ( 'a:b:0:8000::/ffff:ffff:ffff:8000::' ) ) . to . eql ( 'a:b:0:8000::/49' ) ;
25
15
expect ( parseAsCIDR ( '::/::' ) ) . to . eql ( '::/0' ) ;
26
16
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 ( ) ;
28
18
expect ( parseAsCIDR ( 'a::bc:1234/128' ) ) . to . eql ( 'a::bc:1234/128' ) ;
29
19
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 ( ) ;
31
21
expect ( parseAsCIDR ( '10.0.0.0/255.255.0.0' ) ) . to . eql ( '10.0.0.0/16' ) ;
32
22
} ) ;
33
23
} ) ;
@@ -240,4 +230,3 @@ describe('ipv4/6 util', () => {
240
230
} ) ;
241
231
} ) ;
242
232
} ) ;
243
- */
0 commit comments