Skip to content

Instantly share code, notes, and snippets.

@aaronmcadam
Created March 22, 2017 14:42
Show Gist options
  • Save aaronmcadam/b1a18f051c0e49982d76d9b1463ed1b8 to your computer and use it in GitHub Desktop.
Save aaronmcadam/b1a18f051c0e49982d76d9b1463ed1b8 to your computer and use it in GitHub Desktop.
test('returns a genuine token when credentials are set', async () => {
const {
clientId,
clientSecret,
endpoint,
staffEmail: username,
staffPassword: password
} = secrets;
const oauthUrl = `${endpoint}/oauth/token`;
const result = await getAccessToken({
clientId,
clientSecret,
oauthUrl,
username,
password
});
expect(result.status).toBe(200);
expect(result.data.access_token).toBeTruthy();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment