-
Notifications
You must be signed in to change notification settings - Fork 306
Expand file tree
/
Copy pathauthenticator-test.mjs
More file actions
34 lines (28 loc) · 959 Bytes
/
authenticator-test.mjs
File metadata and controls
34 lines (28 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import chai from 'chai'
import chaiAsPromised from 'chai-as-promised'
import { Authenticator } from '../../lib/models/authenticator.mjs'
const { expect } = chai
chai.use(chaiAsPromised)
chai.should()
describe('Authenticator', () => {
describe('constructor()', () => {
it('should initialize the accountManager property', () => {
const accountManager = {}
const auth = new Authenticator({ accountManager })
expect(auth.accountManager).to.equal(accountManager)
})
})
describe('fromParams()', () => {
it('should throw an abstract method error', () => {
expect(() => Authenticator.fromParams())
.to.throw(/Must override method/)
})
})
describe('findValidUser()', () => {
it('should throw an abstract method error', () => {
const auth = new Authenticator({})
expect(() => auth.findValidUser())
.to.throw(/Must override method/)
})
})
})