From 66fdd6e662c488e50b826d474a8cf9b68c6f8b2d Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Fri, 26 Feb 2016 18:23:29 +0100 Subject: [PATCH] 100% test coverage :) --- test/test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/test.js b/test/test.js index 35ac0cf..bb2c8de 100644 --- a/test/test.js +++ b/test/test.js @@ -834,4 +834,19 @@ describe('helpFile', function() { .expect('Access-Control-Allow-Origin', '*') .expect(200, customHelpText, done); }); + + it('GET / with non-existent help file', function(done) { + var customHelpTextPath = path.join(__dirname, 'Some non-existing file.'); + + cors_anywhere = createServer({ + helpFile: customHelpTextPath, + }); + cors_anywhere_port = cors_anywhere.listen(0).address().port; + + request(cors_anywhere) + .get('/') + .type('text/plain') + .expect('Access-Control-Allow-Origin', '*') + .expect(500, '', done); + }); });