import fetch from '../default/fetch.js';
import checkMinifiedJs from './checkMinifiedJs.js';

export default function(urls) {
  return new Promise(function(resolve, reject) {
    let chain = Promise.resolve();

    urls.forEach((url) => {
      chain = chain.then(() => {
        return Promise.resolve(url)
          .then(fetch)
          .then(checkMinifiedJs);
      });
    });

    chain.then(() => { resolve(urls); });
  });
};

import fetch from '../default/fetch.js';
import checkMinifiedJs from './checkMinifiedJs.js';
import checkHttpStatus from '../default/checkHttpStatus.js';

export default function(urls) {
  return new Promise(function(resolve, reject) {
    let chain = Promise.resolve();

    urls.forEach((url) => {
      chain = chain.then(() => {
        return Promise.resolve(url)
          .then(fetch)
          .then(checkHttpStatus)
          .then(checkMinifiedJs)
          .catch(() => {
            outcome.warning('resources', url, 'Not found!');
          });
      });
    });

    chain.then(() => { resolve(urls); });
  });
};

Add check resources http status code
Add check resources http status code
