Innovenergy_trunk/frontend/node_modules/testcafe/lib/custom-client-scripts/load.js

17 lines
2.2 KiB
JavaScript
Raw Normal View History

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const client_script_1 = __importDefault(require("./client-script"));
function createScripts(scriptInits, basePath) {
return scriptInits.map(scriptInit => new client_script_1.default(scriptInit, basePath));
}
async function default_1(scriptInits, basePath) {
const scripts = createScripts(scriptInits, basePath || process.cwd());
await Promise.all(scripts.map(script => script.load()));
return scripts;
}
exports.default = default_1;
module.exports = exports.default;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jdXN0b20tY2xpZW50LXNjcmlwdHMvbG9hZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLG9FQUEyQztBQUczQyxTQUFTLGFBQWEsQ0FBRSxXQUEwQyxFQUFFLFFBQWdCO0lBQ2hGLE9BQU8sV0FBVyxDQUFDLEdBQUcsQ0FBQyxVQUFVLENBQUMsRUFBRSxDQUFDLElBQUksdUJBQVksQ0FBQyxVQUFVLEVBQUUsUUFBUSxDQUFDLENBQUMsQ0FBQztBQUNqRixDQUFDO0FBRWMsS0FBSyxvQkFBVyxXQUEwQyxFQUFFLFFBQWlCO0lBQ3hGLE1BQU0sT0FBTyxHQUFHLGFBQWEsQ0FBQyxXQUFXLEVBQUUsUUFBUSxJQUFJLE9BQU8sQ0FBQyxHQUFHLEVBQUUsQ0FBQyxDQUFDO0lBRXRFLE1BQU0sT0FBTyxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxDQUFDLENBQUMsQ0FBQztJQUV4RCxPQUF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