@@ -113,49 +113,6 @@ describe('ReaderModel', () => {
113113 expect ( cityModel ) . toEqual ( expected ) ;
114114 } ) ;
115115
116- it ( 'returns data when record only contains city record' , async ( ) => {
117- expect . assertions ( 1 ) ;
118-
119- const reader = await Reader . open (
120- './test/data/test-data/GeoIP2-City-Test.mmdb'
121- ) ;
122-
123- const model = reader . city ( '2.2.3.1' ) ;
124-
125- const expected = {
126- city : {
127- geonameId : 2655045 ,
128- names : {
129- en : 'Boxford' ,
130- } ,
131- } ,
132- continent : undefined ,
133- country : undefined ,
134- location : undefined ,
135- maxmind : undefined ,
136- postal : undefined ,
137- registeredCountry : undefined ,
138- representedCountry : undefined ,
139- subdivisions : undefined ,
140- traits : {
141- ipAddress : '2.2.3.1' ,
142- isAnonymous : false ,
143- isAnonymousProxy : false ,
144- isAnonymousVpn : false ,
145- isAnycast : false ,
146- isHostingProvider : false ,
147- isLegitimateProxy : false ,
148- isPublicProxy : false ,
149- isResidentialProxy : false ,
150- isSatelliteProvider : false ,
151- isTorExitNode : false ,
152- network : '2.2.3.0/24' ,
153- } ,
154- } ;
155-
156- expect ( model ) . toEqual ( expected ) ;
157- } ) ;
158-
159116 it ( 'returns data when record only contains continent record' , async ( ) => {
160117 expect . assertions ( 1 ) ;
161118
@@ -500,6 +457,34 @@ describe('ReaderModel', () => {
500457 } ) ;
501458 } ) ;
502459
460+ describe ( 'anonymousPlus()' , ( ) => {
461+ it ( 'returns anonymousPlus data' , async ( ) => {
462+ expect . assertions ( 1 ) ;
463+
464+ const reader = await Reader . open (
465+ './test/data/test-data/GeoIP-Anonymous-Plus-Test.mmdb'
466+ ) ;
467+
468+ const model = reader . anonymousPlus ( '1.2.0.1' ) ;
469+
470+ const expected = {
471+ anonymizerConfidence : 30 ,
472+ ipAddress : '1.2.0.1' ,
473+ isAnonymous : true ,
474+ isAnonymousVpn : true ,
475+ isHostingProvider : false ,
476+ isPublicProxy : false ,
477+ isResidentialProxy : false ,
478+ isTorExitNode : false ,
479+ network : '1.2.0.1/32' ,
480+ networkLastSeen : '2025-04-14' ,
481+ providerName : 'foo' ,
482+ } ;
483+
484+ expect ( model ) . toEqual ( expected ) ;
485+ } ) ;
486+ } ) ;
487+
503488 describe ( 'asn()' , ( ) => {
504489 it ( 'returns asn data' , async ( ) => {
505490 expect . assertions ( 1 ) ;
@@ -690,6 +675,7 @@ describe('ReaderModel', () => {
690675 } ,
691676 } ,
692677 {
678+ confidence : 60 ,
693679 geonameId : 3333217 ,
694680 isoCode : 'WBK' ,
695681 names : {
0 commit comments