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