'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = getMissingTestFiles;

var _ramda;

function _load_ramda() {
  return _ramda = _interopRequireDefault(require('ramda'));
}

var _isGlob;

function _load_isGlob() {
  return _isGlob = _interopRequireDefault(require('is-glob'));
}

var _fs;

function _load_fs() {
  return _fs = _interopRequireDefault(require('fs'));
}

var _index;

function _load_index() {
  return _index = require('./index');
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DSL = ['{PARENT}', '{FILE_NAME}'];

function getMissingTestFiles(tests) {
  var missingTestFiles = [];
  var realTestFiles = tests.filter(function (testFile) {
    var files = DSL.filter(function (pattern) {
      return testFile.indexOf(pattern) > -1;
    });
    var glob = (0, (_isGlob || _load_isGlob()).default)((0, (_index || _load_index()).pathNormalizeToLinux)(testFile));
    return !glob && (_ramda || _load_ramda()).default.isEmpty(files) ? testFile : undefined;
  });
  if (!(_ramda || _load_ramda()).default.isEmpty(realTestFiles)) {
    missingTestFiles = realTestFiles.filter(function (testFile) {
      return !(_fs || _load_fs()).default.existsSync(testFile);
    });
  }
  return missingTestFiles;
}