Skip to content

Commit fbfa6f3

Browse files
committed
test(observables): add unit tests for requestContentLength
1 parent ce979f8 commit fbfa6f3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

perf/server.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var options = {
1212
var httpServer = http.createServer(app)
1313
var httpsServer = https.createServer(options, app)
1414
app.use('/files', express.static(path.join(__dirname, '/files')))
15+
app.get('/fixed-size', (req, res) => res.send('a quick brown fox jumps over the lazy dog'))
1516

1617
const startServer = (app, port) => new Promise((i) => { // eslint-disable-line
1718
const onClose = () => new Promise((i) => server.close(i)) // eslint-disable-line

test/integration/test.observable.js

+8
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,12 @@ test(async function (t) {
3232
.toPromise()
3333
t.same(response.headers['content-length'], '317235')
3434
})
35+
36+
test(async function (t) {
37+
const size = await Observables
38+
.requestContentLength({url: 'https://localhost:3101/fixed-size', strictSSL: false})
39+
.toPromise()
40+
t.same(size, 41)
41+
})
42+
3543
/*eslint-enable */

0 commit comments

Comments
 (0)