unpkg/modules/__tests__/_publicKey-test.js

22 lines
462 B
JavaScript
Raw Normal View History

2018-12-17 17:38:05 +00:00
const request = require('supertest');
2018-09-01 16:36:48 +00:00
2018-12-17 17:38:05 +00:00
const createServer = require('../createServer');
2018-09-01 16:36:48 +00:00
2018-12-17 17:38:05 +00:00
describe('The /_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 /_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('/_publicKey')
2018-09-01 16:36:48 +00:00
.end((err, res) => {
expect(res.text).toMatch(/PUBLIC KEY/);
done();
});
});
});
});