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); });
  });
};

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

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); });
  });
};

Fix missing outcome import