|
f7eb47b…
|
lmata
|
1 |
"use strict"; |
|
f7eb47b…
|
lmata
|
2 |
var __defProp = Object.defineProperty; |
|
f7eb47b…
|
lmata
|
3 |
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; |
|
f7eb47b…
|
lmata
|
4 |
var __getOwnPropNames = Object.getOwnPropertyNames; |
|
f7eb47b…
|
lmata
|
5 |
var __hasOwnProp = Object.prototype.hasOwnProperty; |
|
f7eb47b…
|
lmata
|
6 |
var __export = (target, all) => { |
|
f7eb47b…
|
lmata
|
7 |
for (var name in all) |
|
f7eb47b…
|
lmata
|
8 |
__defProp(target, name, { get: all[name], enumerable: true }); |
|
f7eb47b…
|
lmata
|
9 |
}; |
|
f7eb47b…
|
lmata
|
10 |
var __copyProps = (to, from, except, desc) => { |
|
f7eb47b…
|
lmata
|
11 |
if (from && typeof from === "object" || typeof from === "function") { |
|
f7eb47b…
|
lmata
|
12 |
for (let key of __getOwnPropNames(from)) |
|
f7eb47b…
|
lmata
|
13 |
if (!__hasOwnProp.call(to, key) && key !== except) |
|
f7eb47b…
|
lmata
|
14 |
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); |
|
f7eb47b…
|
lmata
|
15 |
} |
|
f7eb47b…
|
lmata
|
16 |
return to; |
|
f7eb47b…
|
lmata
|
17 |
}; |
|
f7eb47b…
|
lmata
|
18 |
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); |
|
f7eb47b…
|
lmata
|
19 |
var loaderMain_exports = {}; |
|
f7eb47b…
|
lmata
|
20 |
__export(loaderMain_exports, { |
|
f7eb47b…
|
lmata
|
21 |
LoaderMain: () => LoaderMain, |
|
f7eb47b…
|
lmata
|
22 |
create: () => create |
|
f7eb47b…
|
lmata
|
23 |
}); |
|
f7eb47b…
|
lmata
|
24 |
module.exports = __toCommonJS(loaderMain_exports); |
|
f7eb47b…
|
lmata
|
25 |
var import_configLoader = require("../common/configLoader"); |
|
f7eb47b…
|
lmata
|
26 |
var import_esmLoaderHost = require("../common/esmLoaderHost"); |
|
f7eb47b…
|
lmata
|
27 |
var import_poolBuilder = require("../common/poolBuilder"); |
|
f7eb47b…
|
lmata
|
28 |
var import_process = require("../common/process"); |
|
f7eb47b…
|
lmata
|
29 |
var import_testLoader = require("../common/testLoader"); |
|
f7eb47b…
|
lmata
|
30 |
var import_compilationCache = require("../transform/compilationCache"); |
|
f7eb47b…
|
lmata
|
31 |
class LoaderMain extends import_process.ProcessRunner { |
|
f7eb47b…
|
lmata
|
32 |
constructor(serializedConfig) { |
|
f7eb47b…
|
lmata
|
33 |
super(); |
|
f7eb47b…
|
lmata
|
34 |
this._poolBuilder = import_poolBuilder.PoolBuilder.createForLoader(); |
|
f7eb47b…
|
lmata
|
35 |
this._serializedConfig = serializedConfig; |
|
f7eb47b…
|
lmata
|
36 |
} |
|
f7eb47b…
|
lmata
|
37 |
_config() { |
|
f7eb47b…
|
lmata
|
38 |
if (!this._configPromise) |
|
f7eb47b…
|
lmata
|
39 |
this._configPromise = (0, import_configLoader.deserializeConfig)(this._serializedConfig); |
|
f7eb47b…
|
lmata
|
40 |
return this._configPromise; |
|
f7eb47b…
|
lmata
|
41 |
} |
|
f7eb47b…
|
lmata
|
42 |
async loadTestFile(params) { |
|
f7eb47b…
|
lmata
|
43 |
const testErrors = []; |
|
f7eb47b…
|
lmata
|
44 |
const config = await this._config(); |
|
f7eb47b…
|
lmata
|
45 |
const fileSuite = await (0, import_testLoader.loadTestFile)(params.file, config, testErrors); |
|
f7eb47b…
|
lmata
|
46 |
this._poolBuilder.buildPools(fileSuite); |
|
f7eb47b…
|
lmata
|
47 |
return { fileSuite: fileSuite._deepSerialize(), testErrors }; |
|
f7eb47b…
|
lmata
|
48 |
} |
|
f7eb47b…
|
lmata
|
49 |
async getCompilationCacheFromLoader() { |
|
f7eb47b…
|
lmata
|
50 |
await (0, import_esmLoaderHost.incorporateCompilationCache)(); |
|
f7eb47b…
|
lmata
|
51 |
return (0, import_compilationCache.serializeCompilationCache)(); |
|
f7eb47b…
|
lmata
|
52 |
} |
|
f7eb47b…
|
lmata
|
53 |
} |
|
f7eb47b…
|
lmata
|
54 |
const create = (config) => new LoaderMain(config); |
|
f7eb47b…
|
lmata
|
55 |
// Annotate the CommonJS export names for ESM import in node: |
|
f7eb47b…
|
lmata
|
56 |
0 && (module.exports = { |
|
f7eb47b…
|
lmata
|
57 |
LoaderMain, |
|
f7eb47b…
|
lmata
|
58 |
create |
|
f7eb47b…
|
lmata
|
59 |
}); |