});
}); // fetchProfile
- describe('redeemProfileCode', function () {
+ describe('redeemCode', function () {
let expected, urlObj, code, codeVerifier, clientId, redirectURI;
beforeEach(function () {
urlObj = new URL('https://example.com/auth');
me: 'https://profile.example.com/',
};
+ const result = await communication.redeemCode(urlObj, code, codeVerifier, clientId, redirectURI);
+
+ assert.deepStrictEqual(result, expected);
+ });
+ it('covers deprecated method name', async function () {
+ communication.axios.resolves({
+ data: '{"me":"https://profile.example.com/"}',
+ });
+ expected = {
+ me: 'https://profile.example.com/',
+ };
+
const result = await communication.redeemProfileCode(urlObj, code, codeVerifier, clientId, redirectURI);
assert.deepStrictEqual(result, expected);
it('covers failure', async function () {
communication.axios.resolves('Not a JSON payload.');
- const result = await communication.redeemProfileCode(urlObj, code, codeVerifier, clientId, redirectURI);
+ const result = await communication.redeemCode(urlObj, code, codeVerifier, clientId, redirectURI);
assert.strictEqual(result, undefined);
});
- }); // redeemProfileCode
+ }); // redeemCode
describe('introspectToken', function () {
let introspectionUrlObj, authenticationHeader, token;
});
}); // deliverTicket
-}); // Communication
\ No newline at end of file
+}); // Communication