This is a companion code repository for the blog article as titled above. The article guides the reader step by step on how to use ConfigCat's Public API to conduct an integration test.
If you wish to code along with me, you can check out the starter-code
branch. Getting stuck? feel free to view the complete code on the main
branch.
-
Clone this repository.
-
Run the following command to installed the required npm packages:
npm install
- Add your credentials to
utils/axios/axios-instance.js
;
// ...
const axiosInstance = axios.create({
baseURL: 'https://api.configcat.com/v1/',
headers: {
'X-CONFIGCAT-SDKKEY': 'YOUR-CONFIGCAT-SDKKEY'
},
auth: {
username: 'YOUR-AUTH-USERNAME',
password: 'YOUR-AUTH-PASSWORD'
}
});
// ...
- Run the integration test with the following command.
npm run test
If errors are uncovered, they will be thrown and displayed in the console.
Useful links to technical resources.
- ConfigCat Public API Documentation - learn about ConfigCat's public API and how to use it.
- JEST Testing Framework - Learn about JEST and how to use it.
ConfigCat also supports many other frameworks and languages. Check out the full list of supported SDKs here.
You can also explore other code samples for various languages, frameworks, and topics here in the ConfigCat labs on GitHub.
Keep up with ConfigCat on Twitter, Facebook, LinkedIn, and GitHub.
Contributions are welcome!