it('covers success', async function () {
const otpKey = '1234567890123456789012';
await authenticator.createIdentifier(dbCtx, identifier, credential, otpKey);
- assert(authenticator.db.authenticationInsertIdentifier.called);
+ assert(authenticator.db.authenticationUpsert.called);
});
it('covers failure', async function () {
const expected = new Error('blah');
- await authenticator.db.authenticationInsertIdentifier.rejects(expected);
+ await authenticator.db.authenticationUpsert.rejects(expected);
// assert.rejects was not happy to handle this for some reason
try {
await authenticator.createIdentifier(dbCtx, identifier, credential);
assert.fail('no expecte exception');
} catch (e) {
assert.deepStrictEqual(e, expected);
- assert(authenticator.db.authenticationInsertIdentifier.called);
+ assert(authenticator.db.authenticationUpsert.called);
assert(authenticator.logger.error.called);
}
});