-
-
Notifications
You must be signed in to change notification settings - Fork 795
Expand file tree
/
Copy pathexpress.test.ts
More file actions
37 lines (31 loc) · 1.08 KB
/
express.test.ts
File metadata and controls
37 lines (31 loc) · 1.08 KB
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
35
36
37
import axios from 'axios';
import { Server } from 'http';
import { feathers, Application as FeathersApplication } from '@feathersjs/feathers';
import * as express from '@feathersjs/express';
import rest from '@feathersjs/rest-client';
import authClient from '../../src';
import getApp from './fixture';
import commonTests from './commons';
describe('@feathersjs/authentication-client Express integration', () => {
let app: express.Application;
let server: Server;
before(async () => {
const restApp = express.default(feathers())
.use(express.json())
.configure(express.rest())
.use(express.parseAuthentication());
app = getApp(restApp as unknown as FeathersApplication) as express.Application;
app.use(express.errorHandler());
server = await app.listen(9776);
});
after(done => server.close(() => done()));
commonTests(() => app, () => {
return feathers()
.configure(rest('http://localhost:9776').axios(axios))
.configure(authClient());
}, {
email: 'expressauth@feathersjs.com',
password: 'secret',
provider: 'rest'
});
});