Innovenergy_trunk/frontend/node_modules/testcafe/lib/embedding-utils.js

85 lines
11 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const lazyRequire = require('import-lazy')(require);
const hammerhead = lazyRequire('testcafe-hammerhead');
const ReporterPluginHost = lazyRequire('./reporter/plugin-host');
const getTestListModule = lazyRequire('./compiler/test-file/formats/es-next/get-test-list');
const getTypeScriptTestListModule = lazyRequire('./compiler/test-file/formats/typescript/get-test-list');
const getCoffeeScriptTestListModule = lazyRequire('./compiler/test-file/formats/coffeescript/get-test-list');
const COMMAND_TYPE = lazyRequire('./test-run/commands/type');
const ASSERTION_TYPE = lazyRequire('./assertions/type');
const TEST_RUN_PHASE = lazyRequire('./test-run/phase');
const createCommandFromObject = lazyRequire('./test-run/commands/from-object');
const initializers = lazyRequire('./test-run/commands/validations/initializers');
const errorTypes = lazyRequire('./errors/types');
const TestRunErrorFormattableAdapter = lazyRequire('./errors/test-run/formattable-adapter');
const testRunErrors = lazyRequire('./errors/test-run');
const processTestFnError = lazyRequire('./errors/process-test-fn-error');
const testRunErrorUtils = lazyRequire('./errors/test-run/utils');
const browserProviderPool = lazyRequire('./browser/provider/pool');
const BrowserConnection = lazyRequire('./browser/connection');
// NOTE: we can't use lazy require for TestRun and Assignable, because it breaks prototype chain for inherited classes
let TestRun = null;
let Assignable = null;
exports.default = {
TestRunErrorFormattableAdapter,
testRunErrors,
COMMAND_TYPE,
ASSERTION_TYPE,
TEST_RUN_PHASE,
errorTypes,
testRunErrorUtils,
BrowserConnection,
get Assignable() {
if (!Assignable)
Assignable = require('./utils/assignable');
return Assignable;
},
get TestRun() {
if (!TestRun)
TestRun = require('./test-run');
return TestRun;
},
get getTestList() {
return getTestListModule.getTestList;
},
get getTypeScriptTestList() {
return getTypeScriptTestListModule.getTypeScriptTestList;
},
get getCoffeeScriptTestList() {
return getCoffeeScriptTestListModule.getCoffeeScriptTestList;
},
get getTestListFromCode() {
return getTestListModule.getTestListFromCode;
},
get getTypeScriptTestListFromCode() {
return getTypeScriptTestListModule.getTypeScriptTestListFromCode;
},
get getCoffeeScriptTestListFromCode() {
return getCoffeeScriptTestListModule.getCoffeeScriptTestListFromCode;
},
get initSelector() {
return initializers.initSelector;
},
get createCommandFromObject() {
return createCommandFromObject;
},
get processTestFnError() {
return processTestFnError;
},
get browserProviderPool() {
return browserProviderPool;
},
ensureUploadDirectory(...args) {
return hammerhead.UploadStorage.ensureUploadsRoot(...args);
},
copyFilesToUploadFolder(...args) {
return hammerhead.UploadStorage.copy(...args);
},
buildReporterPlugin(pluginFactory, outStream) {
const plugin = pluginFactory();
return new ReporterPluginHost(plugin, outStream);
},
};
module.exports = exports.default;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1iZWRkaW5nLXV0aWxzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2VtYmVkZGluZy11dGlscy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLE1BQU0sV0FBVyxHQUFHLE9BQU8sQ0FBQyxhQUFhLENBQUMsQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUVwRCxNQUFNLFVBQVUsR0FBdUIsV0FBVyxDQUFDLHFCQUFxQixDQUFDLENBQUM7QUFDMUUsTUFBTSxrQkFBa0IsR0FBZSxXQUFXLENBQUMsd0JBQXdCLENBQUMsQ0FBQztBQUM3RSxNQUFNLGlCQUFpQixHQUFnQixXQUFXLENBQUMsb0RBQW9ELENBQUMsQ0FBQztBQUN6RyxNQUFNLDJCQUEyQixHQUFNLFdBQVcsQ0FBQyx1REFBdUQsQ0FBQyxDQUFDO0FBQzVHLE1BQU0sNkJBQTZCLEdBQUksV0FBVyxDQUFDLHlEQUF5RCxDQUFDLENBQUM7QUFDOUcsTUFBTSxZQUFZLEdBQXFCLFdBQVcsQ0FBQywwQkFBMEIsQ0FBQyxDQUFDO0FBQy9FLE1BQU0sY0FBYyxHQUFtQixXQ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