unpkg/modules/__tests__/api-publicKey-test.js

22 lines
461 B
JavaScript
Raw Normal View History

2019-01-06 00:50:05 +00:00
import request from 'supertest';
2018-09-01 16:36:48 +00:00
2019-01-06 00:50:05 +00:00
import createServer from '../createServer';
2018-09-01 16:36:48 +00:00
2018-12-17 17:38:05 +00:00
describe('The /api/publicKey endpoint', () => {
2018-09-01 16:36:48 +00:00
let server;
beforeEach(() => {
server = createServer();
});
2018-12-17 17:38:05 +00:00
describe('GET /api/publicKey', () => {
it('echoes the public key', done => {
2018-09-01 16:36:48 +00:00
request(server)
2018-12-17 17:38:05 +00:00
.get('/api/publicKey')
2018-09-01 16:36:48 +00:00
.end((err, res) => {
expect(res.text).toMatch(/PUBLIC KEY/);
done();
});
});
});
});