Download wp-calypso/client/lib/domains/whois/test/utils.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 997 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/domains/whois/test/utils.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/lib/domains/whois/test/utils.js
-
curl -L -o utils.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/domains/whois/test/utils.js
997 Bytes
| import { whoisType } from '../constants'; | |
| import { findRegistrantWhois, findPrivacyServiceWhois } from '../utils'; | |
| describe( 'utils', () => { | |
| const whoisData = [ | |
| { | |
| org: 'The best company', | |
| type: whoisType.REGISTRANT, | |
| }, | |
| { | |
| org: 'Privacy R US', | |
| type: whoisType.PRIVACY_SERVICE, | |
| }, | |
| ]; | |
| describe( 'findRegistrantWhois', () => { | |
| test( 'should return undefined when not registrant object found', () => { | |
| expect( findRegistrantWhois( [] ) ).toBeUndefined(); | |
| } ); | |
| test( 'should return registrant object from Whois data', () => { | |
| expect( findRegistrantWhois( whoisData ) ).toEqual( whoisData[ 0 ] ); | |
| } ); | |
| } ); | |
| describe( 'findPrivacyServiceWhois', () => { | |
| test( 'should return undefined when not registrant object found', () => { | |
| expect( findPrivacyServiceWhois( [] ) ).toBeUndefined(); | |
| } ); | |
| test( 'should return privacy service object from Whois data', () => { | |
| expect( findPrivacyServiceWhois( whoisData ) ).toEqual( whoisData[ 1 ] ); | |
| } ); | |
| } ); | |
| } ); | |