dist/lib/cli.js
function completeSpecFiles(argv, _filters) {
        // if user manually defined an empty specFiles array, do not add specFiles from folder
        if (Object.keys(_filters.specFiles).length === 0 && !argv.specFiles) {
            io_1.getAllFiles(specsDir, '.spec.ts').forEach(specFile => _filters.specFiles[specFile] = true);
            return true;
        }
        else {
            let removeOnly = true;
            const removeSpecFiles = {};
            for (const specFile in _filters.specFiles) {
                let remove = false;
                let matchStr = specFile;
                if (specFile.substr(0, 1) === '-') {
                    remove = true;
                    matchStr = specFile.substr(1, specFile.length - 1);
                }
                else {
                    removeOnly = false;
                }
                if (remove) {
                    delete _filters.specFiles[specFile];
                    removeSpecFiles[matchStr] = true;
                }
            }
            if (removeOnly) {
                io_1.getAllFiles(specsDir, '.spec.ts')
                    .filter(specFile => !(specFile in removeSpecFiles))
                    .forEach(specFile => _filters.specFiles[specFile] = true);
            }
        }
        return false;
    }
function completeSpecFiles(argv, _filters) {
        // if user manually defined an empty specFiles array, do not add specFiles from folder
        if (Object.keys(_filters.specFiles).length === 0 && !argv.specFiles) {
            io_1.getAllFiles(specsDir, '.spec.ts').forEach(specFile => _filters.specFiles[specFile] = true);
            return true;
        }
        else {
            let removeOnly = true;
            const removeSpecFiles = {};
            for (const specFile in _filters.specFiles) {
                let remove = false;
                let matchStr = specFile;
                if (specFile.substr(0, 1) === '-') {
                    remove = true;
                    matchStr = specFile.substr(1, specFile.length - 1);
                }
                else {
                    removeOnly = false;
                }
                if (remove) {
                    delete _filters.specFiles[specFile];
                    removeSpecFiles[matchStr] = true;
                }
            }
            if (removeOnly) {
                io_1.getAllFiles(specsDir, '.spec.ts')
                    .filter(specFile => !(specFile in removeSpecFiles))
                    .forEach(specFile => _filters.specFiles[specFile] = true);
            }
        }
        return false;
    }
function completeSpecFiles ( argv , _filters ) { // if user manually defined an empty specFiles array, do not add specFiles from folder if ( Object . keys ( _filters . specFiles ) . length === 0 && ! argv . specFiles ) { io_1 . getAllFiles ( specsDir , '.spec.ts' ) . forEach ( specFile => _filters . specFiles [ specFile ] = true ) ; return true ; } else { let removeOnly = true ; const removeSpecFiles = { } ; for ( const specFile in _filters . specFiles ) { let remove = false ; let matchStr = specFile ; if ( specFile . substr ( 0 , 1 ) === '-' ) { remove = true ; matchStr = specFile . substr ( 1 , specFile . length - 1 ) ; } else { removeOnly = false ; } if ( remove ) { delete _filters . specFiles [ specFile ] ; removeSpecFiles [ matchStr ] = true ; } } if ( removeOnly ) { io_1 . getAllFiles ( specsDir , '.spec.ts' ) . filter ( specFile => ! ( specFile in removeSpecFiles ) ) . forEach ( specFile => _filters . specFiles [ specFile ] = true ) ; } } return false ; }
if no spec files are present in filters, use all spec files in specs folder
if no spec files are present in filters use all spec files in specs folder