Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a test for 404 handling

  • Loading branch information...
commit 763cb0f043e423f88b5146147112fb9d7a865860 1 parent 84ffd3a
@naholyr naholyr authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 test/test.js
View
12 test/test.js
@@ -136,6 +136,12 @@ function testhttp () {
x.pipe(resp)
})
+ s.on('/test-not-found', function (req, resp) {
+ var x = filed(__dirname + "/there-is-no-such-file-here.no-extension")
+ req.pipe(x)
+ x.pipe(resp)
+ })
+
s.listen(port, function () {
fs.createReadStream(testfile).pipe(request.put(url+'/test-req'))
@@ -189,6 +195,12 @@ function testhttp () {
console.log("Passed GET of directory index, full pipe")
})
+ request.get(url+'/test-not-found', function (e, resp, body) {
+ if (e) throw e
+ if (resp.statusCode !== 404) throw new Error('Status code is not 404 it is '+resp.statusCode)
+ console.log("Passed Not Found produces 404")
+ })
+
})
}
Please sign in to comment.
Something went wrong with that request. Please try again.