"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateSuitMap = void 0;
const specs_1 = require("./specs");
function reformatFiles(files) {
    let testFileMap = {};
    files.forEach(file => {
        let filename = file.prefixName;
        if (!testFileMap[filename]) {
            testFileMap[filename] = [];
        }
        testFileMap[filename].push(file);
    });
    return testFileMap;
}
function generateSpecs(testFileMap) {
    let fileNames = Object.keys(testFileMap);
    let suits = [];
    for (let name of fileNames) {
        let files = testFileMap[name];
        let specs = [];
        for (let file of files) {
            let spec = new specs_1.Spec(file.lastName, file);
            spec.suitName = name;
            specs.push(spec);
        }
        let suit = new specs_1.Suit(name, specs);
        suits.push(suit);
    }
    return suits;
}
function generateSuitMap(sourceFiles, targetFiles) {
    let testFileMap = reformatFiles(sourceFiles);
    let suits = generateSpecs(testFileMap);
    return suits;
}
exports.generateSuitMap = generateSuitMap;
