-
-
Notifications
You must be signed in to change notification settings - Fork 795
Expand file tree
/
Copy pathindex.test.ts
More file actions
29 lines (24 loc) · 917 Bytes
/
index.test.ts
File metadata and controls
29 lines (24 loc) · 917 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
import { strict as assert } from 'assert';
import { feathers } from '@feathersjs/feathers';
import { setup, express, OauthSetupSettings } from '../src';
import { AuthenticationService } from '@feathersjs/authentication';
describe('@feathersjs/authentication-oauth', () => {
describe('setup', () => {
it('errors when service does not exist', () => {
const app = feathers();
try {
app.configure(setup({ authService: 'something' } as OauthSetupSettings));
assert.fail('Should never get here');
} catch (error) {
assert.equal(error.message,
'An authentication service must exist before registering @feathersjs/authentication-oauth'
);
}
});
it('errors when service does not exist', () => {
const app = feathers();
app.use('/authentication', new AuthenticationService(app));
app.configure(express());
});
});
});