Skip to content

Commit 42b2bfc

Browse files
committed
adding a test to check the size of the response
1 parent 10b5bbd commit 42b2bfc

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

test/http.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,22 @@ describe('HTTP APIs', function () {
113113
})
114114

115115
describe('GET API', function () {
116+
it('should have the same size of the file on disk', function (done) {
117+
server.get('/sampleContainer/solid.png')
118+
.expect(200)
119+
.end(function (err, res) {
120+
if (err) {
121+
return done(err)
122+
}
123+
124+
var size = fs.statSync(__dirname + '/resources/sampleContainer/solid.png').size
125+
if (res.body.length !== size) {
126+
return done(new Error('files are not of the same size'))
127+
}
128+
done()
129+
})
130+
})
131+
116132
it('should have Access-Control-Allow-Origin as Origin on containers', function (done) {
117133
server.get('/sampleContainer')
118134
.set('Origin', 'http://example.com')
11.8 KB
Loading

0 commit comments

Comments
 (0)