-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplugin.test.js
More file actions
39 lines (32 loc) · 780 Bytes
/
plugin.test.js
File metadata and controls
39 lines (32 loc) · 780 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
35
36
37
38
39
const assert = require('assert');
const http = require('http');
const path = require('path');
const express = require('express');
let Application = undefined;
beforeAll((done) => {
const app = express();
app.get('/', (_, res, next) => {
res.setHeader('Content-Type', 'text/plain');
res.send('hello world');
next();
});
Application = app.listen(8081, done);
});
afterAll((done) => {
Application.close(done);
})
describe('Route path', () => {
it('should receive a compressed response', done => {
const options = {
host: 'localhost',
port: 8080,
headers: {
'Accept-Encoding': 'gzip'
}
};
http.get(options, res => {
assert.equal(res.headers['content-encoding'], 'gzip');
done();
});
});
});