From fa90936e46ed82f4d5e749276f28bab9112fdfd5 Mon Sep 17 00:00:00 2001 From: Adrien Castex Date: Sat, 13 May 2017 16:00:18 +0200 Subject: [PATCH] Fixed the test --- test/tests/options.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tests/options.js b/test/tests/options.js index 96c161a0..277e25cc 100644 --- a/test/tests/options.js +++ b/test/tests/options.js @@ -1,7 +1,7 @@ var webdav = require('../../lib/index.js'), request = require('request') -module.exports = (test, options, index) => test('options method', isValid => +module.exports = (test, options, index) => test('OPTIONS method', isValid => { var server = new webdav.WebDAVServer(); server.start(options.port + index); @@ -11,6 +11,6 @@ module.exports = (test, options, index) => test('options method', isValid => url: 'http://localhost:' + (options.port + index), method: 'OPTIONS' }, (e, res, body) => { - isValid(res.headers.allow && res.headers.allow.length >= 3 && /^[a-zA-Z,]+$/g.test(res.headers.allow)); + isValid(!e && res.headers.allow && res.headers.allow.length >= 3 && /^[a-zA-Z,]+$/g.test(res.headers.allow)); }) }) \ No newline at end of file