We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8e0fd8 commit bd638c1Copy full SHA for bd638c1
test/req.range.js
@@ -44,6 +44,26 @@ describe('req', function(){
44
.expect(200, '[{"start":0,"end":74}]', done)
45
})
46
47
+ it('should throw TypeError for invalid size', function () {
48
+ var app = express();
49
+
50
+ app.use(function (req, res) {
51
+ try {
52
+ req.range(-1);
53
+ } catch (err) {
54
+ res.status(500).send(err.name + ': ' + err.message);
55
+ return;
56
+ }
57
+ res.send('no error');
58
+ });
59
60
+ return request(app)
61
+ .get('/')
62
+ .set('Range', 'bytes=0-10')
63
+ .expect(500)
64
+ .expect(/TypeError: size must be a non-negative integer to req\.range/);
65
66
67
it('should have a .type', function (done) {
68
var app = express()
69
0 commit comments