is an example Mocha and Chai automated test of the Google Civic Information Elections API
Prerequisites You need Nodejs npm/npx Installed to be able to run this project on your machine.
git clone git@https://github.com:corey-bailey/civic-info-elections-query-api.git
npm install
export APIKEY=PASS-IN-YOUR-GOOGLE-API-KEY-HERE
npx mocha
_____ _ _ _ ___ ______ _____ _____ _
| ___| | | | (_) / _ \ | ___ \_ _| |_ _| | |
| |__ | | ___ ___| |_ _ ___ _ __ / /_\ \| |_/ / | | | | ___ ___| |_
| __|| |/ _ \/ __| __| |/ _ \| '_ \ | _ || __/ | | | |/ _ \/ __| __|
| |___| | __/ (__| |_| | (_) | | | | | | | || | _| |_ | | __/\__ \ |_
\____/|_|\___|\___|\__|_|\___/|_| |_| \_| |_/\_| \___/ \_/\___||___/\__|
civic-info-api
elections
elections positive tests
✓ validate civicinfo response contract (268ms)
✓ validate election id (175ms)
✓ validate election name (184ms)
✓ validate election day (178ms)
✓ validate election ocd division id (175ms)
elections negative tests
✓ elections bad api key (137ms)
✓ elections bad elections version (254ms)
7 passing (1s)