-
Notifications
You must be signed in to change notification settings - Fork 306
Expand file tree
/
Copy pathauthenticator-test.js
More file actions
34 lines (28 loc) · 911 Bytes
/
authenticator-test.js
File metadata and controls
34 lines (28 loc) · 911 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
'use strict'
const chai = require('chai')
const { expect } = chai
chai.use(require('chai-as-promised'))
chai.should()
const { Authenticator } = require('../../lib/models/authenticator')
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/)
})
})
})