# Testing

This is a file create for test with all functions or all most all the functions.

```javascript
const { getCountryInfo, getContinent, getAllCountries, getCountryByCode, getCountryByTLD, searchCountries } = require('./index');

// Test getCountryInfo
const afghanistanInfo = getCountryInfo('Afghanistan');
console.log('Afghanistan Info:', afghanistanInfo);

const capitalEn = getCountryInfo('China', 'capital_en');
console.log('China Capital (English):', capitalEn);

const chinaFields = getCountryInfo('China', ['capital_en', 'code_2', 'tld']);
console.log('China Fields:', chinaFields);

// Test getContinent
const africaCountries = getContinent('Africa');
console.log('African Countries:', africaCountries);

const africaFields = getContinent('Africa', ['capital_en', 'code_2', 'tld']);
console.log('African Countries Fields:', africaFields);

// Test getAllCountries
const allCountriesData = getAllCountries(['name_en', 'code_2']);
console.log('All Countries Data:', allCountriesData);

// Test getCountryByCode
const germanyByCode = getCountryByCode('DE', ['name_en', 'capital_en']);
console.log('Germany by Code:', germanyByCode);

// Get country by top-level domain
const countryByTLD = getCountryByTLD('.us');
console.log('Country by TLD:', countryByTLD);

// Search countries by keyword
const countriesByKeyword = searchCountries('united', ['name_en', 'capital_en']);
console.log('Countries by Keyword:', countriesByKeyword);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://npms.gitbook.io/country-info/reference/testing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
