From aea1f081c65eb6165c5a80b24f0057af536d44af Mon Sep 17 00:00:00 2001 From: freearhey Date: Sun, 8 Sep 2019 15:43:45 +0300 Subject: [PATCH] Update index.js - increased timeout up to 60 seconds - changed valid response status code range - removed errors type check --- test/index.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/index.js b/test/index.js index 09aa41d6f6..6f79064d86 100644 --- a/test/index.js +++ b/test/index.js @@ -5,7 +5,7 @@ const https = require('https') const verbose = process.env.npm_config_debug || false const errorLog = 'error.log' const config = { - timeout: 1000, + timeout: 60000, delay: 200 } @@ -21,7 +21,7 @@ const instance = axios.create({ rejectUnauthorized: false }), validateStatus: function (status) { - return status >= 200 && status < 404 + return status >= 200 && status < 400 }, headers: { 'Accept': '*/*', @@ -81,13 +81,9 @@ async function test() { } catch (err) { - if(err.response || (err.request && ['ENOTFOUND'].indexOf(err.code) > -1)) { - - stats.failures++ + stats.failures++ - writeToLog(country.url, err.message, item.url) - - } + writeToLog(country.url, err.message, item.url) }