@memlab/api 1.0.39 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/API.d.ts +1 -1
- package/dist/API.js +33 -34
- package/dist/__tests__/API/E2EBasicAnalysis.test.d.ts +1 -1
- package/dist/__tests__/API/E2EBasicAnalysis.test.js +1 -1
- package/dist/__tests__/API/E2EDetachedDOMAnalysis.test.d.ts +1 -1
- package/dist/__tests__/API/E2EDetachedDOMAnalysis.test.js +1 -1
- package/dist/__tests__/API/E2EFindLeaks.example.d.ts +1 -1
- package/dist/__tests__/API/E2EFindLeaks.example.js +1 -1
- package/dist/__tests__/API/E2EFindMemoryLeaks.test.d.ts +1 -1
- package/dist/__tests__/API/E2EFindMemoryLeaks.test.js +1 -1
- package/dist/__tests__/API/E2EFindMemoryLeaksWithSnapshotFiles.test.d.ts +1 -1
- package/dist/__tests__/API/E2EFindMemoryLeaksWithSnapshotFiles.test.js +1 -1
- package/dist/__tests__/API/E2EFindTaggedMemoryLeaks.test.d.ts +1 -1
- package/dist/__tests__/API/E2EFindTaggedMemoryLeaks.test.js +1 -1
- package/dist/__tests__/API/E2EInjectLeaksWithSetup.test.d.ts +1 -1
- package/dist/__tests__/API/E2EInjectLeaksWithSetup.test.js +1 -1
- package/dist/__tests__/API/E2EMemoryLeakFilter.test.d.ts +1 -1
- package/dist/__tests__/API/E2EMemoryLeakFilter.test.js +1 -1
- package/dist/__tests__/API/E2EReloadInSetup.test.d.ts +1 -1
- package/dist/__tests__/API/E2EReloadInSetup.test.js +1 -1
- package/dist/__tests__/API/E2EResultReader.test.d.ts +1 -1
- package/dist/__tests__/API/E2EResultReader.test.js +1 -1
- package/dist/__tests__/API/E2ERunMultipleSnapshots.example.d.ts +1 -1
- package/dist/__tests__/API/E2ERunMultipleSnapshots.example.js +1 -1
- package/dist/__tests__/API/E2ERunSingleSnapshot.example.d.ts +1 -1
- package/dist/__tests__/API/E2ERunSingleSnapshot.example.js +1 -1
- package/dist/__tests__/API/E2EShapeUnboundGrowthAnalysis.test.d.ts +1 -1
- package/dist/__tests__/API/E2EShapeUnboundGrowthAnalysis.test.js +1 -1
- package/dist/__tests__/API/E2EStringAnalysis.test.d.ts +1 -1
- package/dist/__tests__/API/E2EStringAnalysis.test.js +1 -1
- package/dist/__tests__/API/E2ETestScenarioCallback.test.d.ts +1 -1
- package/dist/__tests__/API/E2ETestScenarioCallback.test.js +1 -1
- package/dist/__tests__/API/lib/E2ETestSettings.d.ts +1 -1
- package/dist/__tests__/API/lib/E2ETestSettings.d.ts.map +1 -1
- package/dist/__tests__/API/lib/E2ETestSettings.js +3 -3
- package/dist/__tests__/heap/E2EHeapParser.test.d.ts +1 -1
- package/dist/__tests__/heap/E2EHeapParser.test.js +1 -1
- package/dist/__tests__/heap/examples/example-1.d.ts +1 -1
- package/dist/__tests__/heap/examples/example-1.js +1 -1
- package/dist/__tests__/heap/examples/example-2.d.ts +1 -1
- package/dist/__tests__/heap/examples/example-2.js +1 -1
- package/dist/__tests__/heap/examples/example-3.d.ts +1 -1
- package/dist/__tests__/heap/examples/example-3.js +1 -1
- package/dist/__tests__/heap/examples/example-4.d.ts +1 -1
- package/dist/__tests__/heap/examples/example-4.js +1 -1
- package/dist/__tests__/heap/examples/example-5.test.d.ts +1 -1
- package/dist/__tests__/heap/examples/example-5.test.js +1 -1
- package/dist/__tests__/heap/examples/example-6.d.ts +1 -1
- package/dist/__tests__/heap/examples/example-6.js +1 -1
- package/dist/__tests__/heap/examples/example-7.test.d.ts +1 -1
- package/dist/__tests__/heap/examples/example-7.test.js +1 -1
- package/dist/__tests__/heap/lib/HeapParserTestUtils.d.ts +1 -1
- package/dist/__tests__/heap/lib/HeapParserTestUtils.js +2 -3
- package/dist/__tests__/packages/heap-analysis.test.d.ts +1 -1
- package/dist/__tests__/packages/heap-analysis.test.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/APIUtils.d.ts +1 -1
- package/dist/lib/APIUtils.js +4 -4
- package/dist/result-reader/BaseResultReader.d.ts +1 -1
- package/dist/result-reader/BaseResultReader.js +1 -1
- package/dist/result-reader/BrowserInteractionResultReader.d.ts +1 -1
- package/dist/result-reader/BrowserInteractionResultReader.js +1 -1
- package/dist/result-reader/SnapshotResultReader.d.ts +1 -1
- package/dist/result-reader/SnapshotResultReader.js +1 -1
- package/dist/state/APIStateManager.d.ts +1 -1
- package/dist/state/APIStateManager.js +1 -1
- package/dist/state/ConsoleModeManager.d.ts +1 -1
- package/dist/state/ConsoleModeManager.js +2 -2
- package/dist/state/PuppeteerConfigManager.d.ts +1 -1
- package/dist/state/PuppeteerConfigManager.js +1 -1
- package/package.json +6 -6
package/dist/API.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @format
|
|
8
|
-
* @oncall
|
|
8
|
+
* @oncall memory_lab
|
|
9
9
|
*/
|
|
10
10
|
import type { ParsedArgs } from 'minimist';
|
|
11
11
|
import type { AnyFunction, ISerializedInfo, IScenario, Optional } from '@memlab/core';
|
package/dist/API.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -21,7 +21,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
21
21
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.
|
|
24
|
+
exports.warmupAndTakeSnapshots = warmupAndTakeSnapshots;
|
|
25
|
+
exports.run = run;
|
|
26
|
+
exports.takeSnapshots = takeSnapshots;
|
|
27
|
+
exports.findLeaks = findLeaks;
|
|
28
|
+
exports.findLeaksBySnapshotFilePaths = findLeaksBySnapshotFilePaths;
|
|
29
|
+
exports.analyze = analyze;
|
|
30
|
+
exports.warmup = warmup;
|
|
31
|
+
exports.testInBrowser = testInBrowser;
|
|
25
32
|
const core_1 = require("@memlab/core");
|
|
26
33
|
const e2e_1 = require("@memlab/e2e");
|
|
27
34
|
const APIUtils_1 = __importDefault(require("./lib/APIUtils"));
|
|
@@ -46,8 +53,8 @@ const APIStateManager_1 = __importDefault(require("./state/APIStateManager"));
|
|
|
46
53
|
* })();
|
|
47
54
|
* ```
|
|
48
55
|
*/
|
|
49
|
-
function warmupAndTakeSnapshots(
|
|
50
|
-
return __awaiter(this,
|
|
56
|
+
function warmupAndTakeSnapshots() {
|
|
57
|
+
return __awaiter(this, arguments, void 0, function* (options = {}) {
|
|
51
58
|
const config = getConfigFromRunOptions(options);
|
|
52
59
|
const state = APIStateManager_1.default.getAndUpdateState(config, options);
|
|
53
60
|
const testPlanner = new e2e_1.TestPlanner({ config });
|
|
@@ -61,7 +68,6 @@ function warmupAndTakeSnapshots(options = {}) {
|
|
|
61
68
|
return ret;
|
|
62
69
|
});
|
|
63
70
|
}
|
|
64
|
-
exports.warmupAndTakeSnapshots = warmupAndTakeSnapshots;
|
|
65
71
|
/**
|
|
66
72
|
* This API runs browser interaction and find memory leaks triggered in browser
|
|
67
73
|
* This is equivalent to running `memlab run` in CLI.
|
|
@@ -83,8 +89,8 @@ exports.warmupAndTakeSnapshots = warmupAndTakeSnapshots;
|
|
|
83
89
|
* })();
|
|
84
90
|
* ```
|
|
85
91
|
*/
|
|
86
|
-
function run(
|
|
87
|
-
return __awaiter(this,
|
|
92
|
+
function run() {
|
|
93
|
+
return __awaiter(this, arguments, void 0, function* (options = {}) {
|
|
88
94
|
const config = getConfigFromRunOptions(options);
|
|
89
95
|
const state = APIStateManager_1.default.getAndUpdateState(config, options);
|
|
90
96
|
const testPlanner = new e2e_1.TestPlanner({ config });
|
|
@@ -99,7 +105,6 @@ function run(options = {}) {
|
|
|
99
105
|
return { leaks, runResult };
|
|
100
106
|
});
|
|
101
107
|
}
|
|
102
|
-
exports.run = run;
|
|
103
108
|
/**
|
|
104
109
|
* This API runs E2E interaction and takes heap snapshots.
|
|
105
110
|
* This is equivalent to running `memlab snapshot` in CLI.
|
|
@@ -118,8 +123,8 @@ exports.run = run;
|
|
|
118
123
|
* })();
|
|
119
124
|
* ```
|
|
120
125
|
*/
|
|
121
|
-
function takeSnapshots(
|
|
122
|
-
return __awaiter(this,
|
|
126
|
+
function takeSnapshots() {
|
|
127
|
+
return __awaiter(this, arguments, void 0, function* (options = {}) {
|
|
123
128
|
const config = getConfigFromRunOptions(options);
|
|
124
129
|
const state = APIStateManager_1.default.getAndUpdateState(config, options);
|
|
125
130
|
const testPlanner = new e2e_1.TestPlanner();
|
|
@@ -130,7 +135,6 @@ function takeSnapshots(options = {}) {
|
|
|
130
135
|
return ret;
|
|
131
136
|
});
|
|
132
137
|
}
|
|
133
|
-
exports.takeSnapshots = takeSnapshots;
|
|
134
138
|
/**
|
|
135
139
|
* This API finds memory leaks by analyzing heap snapshot(s).
|
|
136
140
|
* This is equivalent to `memlab find-leaks` in CLI.
|
|
@@ -153,8 +157,8 @@ exports.takeSnapshots = takeSnapshots;
|
|
|
153
157
|
* })();
|
|
154
158
|
* ```
|
|
155
159
|
*/
|
|
156
|
-
function findLeaks(
|
|
157
|
-
return __awaiter(this,
|
|
160
|
+
function findLeaks(runResult_1) {
|
|
161
|
+
return __awaiter(this, arguments, void 0, function* (runResult, options = {}) {
|
|
158
162
|
const state = APIStateManager_1.default.getAndUpdateState(core_1.config, options);
|
|
159
163
|
const workDir = runResult.getRootDirectory();
|
|
160
164
|
core_1.fileManager.initDirs(core_1.config, { workDir });
|
|
@@ -164,7 +168,6 @@ function findLeaks(runResult, options = {}) {
|
|
|
164
168
|
return ret;
|
|
165
169
|
});
|
|
166
170
|
}
|
|
167
|
-
exports.findLeaks = findLeaks;
|
|
168
171
|
/**
|
|
169
172
|
* This API finds memory leaks by analyzing specified heap snapshots.
|
|
170
173
|
* This is equivalent to `memlab find-leaks` with
|
|
@@ -180,8 +183,8 @@ exports.findLeaks = findLeaks;
|
|
|
180
183
|
* mode (see {@link ConsoleMode})
|
|
181
184
|
* @returns leak traces detected and clustered from the browser interaction
|
|
182
185
|
*/
|
|
183
|
-
function findLeaksBySnapshotFilePaths(
|
|
184
|
-
return __awaiter(this,
|
|
186
|
+
function findLeaksBySnapshotFilePaths(baselineSnapshot_1, targetSnapshot_1, finalSnapshot_1) {
|
|
187
|
+
return __awaiter(this, arguments, void 0, function* (baselineSnapshot, targetSnapshot, finalSnapshot, options = {}) {
|
|
185
188
|
const state = APIStateManager_1.default.getAndUpdateState(core_1.config, options);
|
|
186
189
|
core_1.config.useExternalSnapshot = true;
|
|
187
190
|
core_1.config.externalSnapshotFilePaths = [
|
|
@@ -196,7 +199,6 @@ function findLeaksBySnapshotFilePaths(baselineSnapshot, targetSnapshot, finalSna
|
|
|
196
199
|
return ret;
|
|
197
200
|
});
|
|
198
201
|
}
|
|
199
|
-
exports.findLeaksBySnapshotFilePaths = findLeaksBySnapshotFilePaths;
|
|
200
202
|
/**
|
|
201
203
|
* This API analyzes heap snapshot(s) with a specified heap analysis.
|
|
202
204
|
* This is equivalent to `memlab analyze` in CLI.
|
|
@@ -221,14 +223,13 @@ exports.findLeaksBySnapshotFilePaths = findLeaksBySnapshotFilePaths;
|
|
|
221
223
|
* })();
|
|
222
224
|
* ```
|
|
223
225
|
*/
|
|
224
|
-
function analyze(
|
|
225
|
-
return __awaiter(this,
|
|
226
|
+
function analyze(runResult_1, heapAnalyzer_1) {
|
|
227
|
+
return __awaiter(this, arguments, void 0, function* (runResult, heapAnalyzer, args = { _: [] }) {
|
|
226
228
|
const workDir = runResult.getRootDirectory();
|
|
227
229
|
core_1.fileManager.initDirs(core_1.config, { workDir });
|
|
228
230
|
return yield heapAnalyzer.run({ args });
|
|
229
231
|
});
|
|
230
232
|
}
|
|
231
|
-
exports.analyze = analyze;
|
|
232
233
|
/**
|
|
233
234
|
* This warms up web server by sending web requests to the web sever.
|
|
234
235
|
* This is equivalent to running `memlab warmup` in CLI.
|
|
@@ -236,9 +237,9 @@ exports.analyze = analyze;
|
|
|
236
237
|
*
|
|
237
238
|
* @param options configure browser interaction run
|
|
238
239
|
*/
|
|
239
|
-
function warmup(
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
function warmup() {
|
|
241
|
+
return __awaiter(this, arguments, void 0, function* (options = {}) {
|
|
242
|
+
var _a, _b;
|
|
242
243
|
const config = (_a = options.config) !== null && _a !== void 0 ? _a : core_1.config;
|
|
243
244
|
if (config.verbose) {
|
|
244
245
|
core_1.info.lowLevel(`Xvfb: ${config.useXVFB}`);
|
|
@@ -275,7 +276,6 @@ function warmup(options = {}) {
|
|
|
275
276
|
}
|
|
276
277
|
});
|
|
277
278
|
}
|
|
278
|
-
exports.warmup = warmup;
|
|
279
279
|
function getConfigFromRunOptions(options) {
|
|
280
280
|
let config = core_1.MemLabConfig.getInstance();
|
|
281
281
|
if (options.workDir) {
|
|
@@ -297,9 +297,9 @@ function getConfigFromRunOptions(options) {
|
|
|
297
297
|
config.isFullRun = !!options.snapshotForEachStep;
|
|
298
298
|
return config;
|
|
299
299
|
}
|
|
300
|
-
function setupPage(
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
function setupPage(page_1) {
|
|
301
|
+
return __awaiter(this, arguments, void 0, function* (page, options = {}) {
|
|
302
|
+
var _a, _b, _c;
|
|
303
303
|
const config = (_a = options.config) !== null && _a !== void 0 ? _a : core_1.config;
|
|
304
304
|
const testPlanner = (_b = options.testPlanner) !== null && _b !== void 0 ? _b : e2e_1.defaultTestPlanner;
|
|
305
305
|
if (config.emulateDevice) {
|
|
@@ -321,9 +321,9 @@ function setupPage(page, options = {}) {
|
|
|
321
321
|
}));
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
|
-
function initBrowserInfoInConfig(
|
|
325
|
-
|
|
326
|
-
|
|
324
|
+
function initBrowserInfoInConfig(browser_1) {
|
|
325
|
+
return __awaiter(this, arguments, void 0, function* (browser, options = {}) {
|
|
326
|
+
var _a;
|
|
327
327
|
const config = (_a = options.config) !== null && _a !== void 0 ? _a : core_1.config;
|
|
328
328
|
core_1.browserInfo.recordPuppeteerConfig(config.puppeteerConfig);
|
|
329
329
|
const version = yield browser.version();
|
|
@@ -337,9 +337,9 @@ function initBrowserInfoInConfig(browser, options = {}) {
|
|
|
337
337
|
* Browser interaction API used by MemLab API and MemLab CLI
|
|
338
338
|
* @internal
|
|
339
339
|
*/
|
|
340
|
-
function testInBrowser(
|
|
341
|
-
|
|
342
|
-
|
|
340
|
+
function testInBrowser() {
|
|
341
|
+
return __awaiter(this, arguments, void 0, function* (options = {}) {
|
|
342
|
+
var _a, _b;
|
|
343
343
|
const config = (_a = options.config) !== null && _a !== void 0 ? _a : core_1.config;
|
|
344
344
|
if (config.verbose) {
|
|
345
345
|
core_1.info.lowLevel(`Xvfb: ${config.useXVFB}`);
|
|
@@ -393,4 +393,3 @@ function testInBrowser(options = {}) {
|
|
|
393
393
|
}
|
|
394
394
|
});
|
|
395
395
|
}
|
|
396
|
-
exports.testInBrowser = testInBrowser;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2ETestSettings.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/API/lib/E2ETestSettings.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,WAAW,QAAgB,CAAC;AAEzC,eAAO,MAAM,mBAAmB;;;;CAAkB,CAAC;AAEnD,eAAO,MAAM,QAAQ;eACV,MAAM;eACN,MAAM;mBACM,IAAI,KAAG,
|
|
1
|
+
{"version":3,"file":"E2ETestSettings.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/API/lib/E2ETestSettings.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,WAAW,QAAgB,CAAC;AAEzC,eAAO,MAAM,mBAAmB;;;;CAAkB,CAAC;AAEnD,eAAO,MAAM,QAAQ;eACV,MAAM;eACN,MAAM;mBACM,IAAI,KAAG,OAAO,CAAC,IAAI,CAAC;CAE1C,CAAC;AAEF,eAAO,MAAM,SAAS,QAAO,IAK5B,CAAC;AAGF,wBAAgB,WAAW,IAAI,MAAM,CAEpC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -18,7 +18,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.
|
|
21
|
+
exports.testSetup = exports.scenario = exports.defaultAnalysisArgs = exports.testTimeout = void 0;
|
|
22
|
+
exports.getUniqueID = getUniqueID;
|
|
22
23
|
const core_1 = require("@memlab/core");
|
|
23
24
|
exports.testTimeout = 5 * 60 * 1000;
|
|
24
25
|
exports.defaultAnalysisArgs = { args: { _: [] } };
|
|
@@ -38,4 +39,3 @@ let uindex = 1;
|
|
|
38
39
|
function getUniqueID() {
|
|
39
40
|
return `${process.pid}-${Date.now()}-${uindex++}`;
|
|
40
41
|
}
|
|
41
|
-
exports.getUniqueID = getUniqueID;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @format
|
|
8
|
-
* @oncall
|
|
8
|
+
* @oncall memory_lab
|
|
9
9
|
*/
|
|
10
10
|
import type { IHeapSnapshot } from '@memlab/core';
|
|
11
11
|
export declare function isExpectedSnapshot(leakInjector: () => void, checkSnapshotCb: (snapshot: IHeapSnapshot) => boolean): Promise<void>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -21,7 +21,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
21
21
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.isExpectedSnapshot =
|
|
24
|
+
exports.isExpectedSnapshot = isExpectedSnapshot;
|
|
25
25
|
const fs_1 = __importDefault(require("fs"));
|
|
26
26
|
const path_1 = __importDefault(require("path"));
|
|
27
27
|
const core_1 = require("@memlab/core");
|
|
@@ -34,7 +34,6 @@ function isExpectedSnapshot(leakInjector, checkSnapshotCb) {
|
|
|
34
34
|
expect(checkSnapshotCb(snapshot)).toBe(true);
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
exports.isExpectedSnapshot = isExpectedSnapshot;
|
|
38
37
|
function getHeapDirPrefix() {
|
|
39
38
|
const dir = path_1.default.join(core_1.config.dataBaseDir, 'gen-files');
|
|
40
39
|
if (!fs_1.default.existsSync(dir)) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
12
|
if (k2 === undefined) k2 = k;
|
|
@@ -35,7 +35,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.config = exports.takeNodeMinimalHeap = exports.getNodeInnocentHeap = exports.dumpNodeHeapSnapshot = exports.SnapshotResultReader = exports.BrowserInteractionResultReader =
|
|
38
|
+
exports.config = exports.takeNodeMinimalHeap = exports.getNodeInnocentHeap = exports.dumpNodeHeapSnapshot = exports.SnapshotResultReader = exports.BrowserInteractionResultReader = void 0;
|
|
39
|
+
exports.registerPackage = registerPackage;
|
|
39
40
|
const path_1 = __importDefault(require("path"));
|
|
40
41
|
const core_1 = require("@memlab/core");
|
|
41
42
|
/** @internal */
|
|
@@ -44,7 +45,6 @@ function registerPackage() {
|
|
|
44
45
|
return core_1.PackageInfoLoader.registerPackage(path_1.default.join(__dirname, '..'));
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
|
-
exports.registerPackage = registerPackage;
|
|
48
48
|
__exportStar(require("./API"), exports);
|
|
49
49
|
__exportStar(require("@memlab/heap-analysis"), exports);
|
|
50
50
|
__exportStar(require("./state/ConsoleModeManager"), exports);
|
package/dist/lib/APIUtils.d.ts
CHANGED
package/dist/lib/APIUtils.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -24,9 +24,9 @@ const puppeteer = core_1.constant.isFRL
|
|
|
24
24
|
: core_1.constant.isFB
|
|
25
25
|
? require('puppeteer-core')
|
|
26
26
|
: require('puppeteer');
|
|
27
|
-
function getBrowser(
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
function getBrowser() {
|
|
28
|
+
return __awaiter(this, arguments, void 0, function* (options = {}) {
|
|
29
|
+
var _a;
|
|
30
30
|
const runConfig = (_a = options.config) !== null && _a !== void 0 ? _a : core_1.config;
|
|
31
31
|
let browser;
|
|
32
32
|
core_1.utils.tryToMutePuppeteerWarning();
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
* @format
|
|
8
|
-
* @oncall
|
|
8
|
+
* @oncall memory_lab
|
|
9
9
|
*/
|
|
10
10
|
import type { MemLabConfig, Optional, PuppeteerConfig } from '@memlab/core';
|
|
11
11
|
import type { ConsoleMode } from './ConsoleModeManager';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall
|
|
9
|
+
* @oncall memory_lab
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ConsoleMode = void 0;
|
|
@@ -33,7 +33,7 @@ var ConsoleMode;
|
|
|
33
33
|
* verbose mode, there could be terminal output overwrite and animation
|
|
34
34
|
*/
|
|
35
35
|
ConsoleMode["VERBOSE"] = "VERBOSE";
|
|
36
|
-
})(ConsoleMode
|
|
36
|
+
})(ConsoleMode || (exports.ConsoleMode = ConsoleMode = {}));
|
|
37
37
|
/**
|
|
38
38
|
* Manage, save, and restore the current state of the Console modes.
|
|
39
39
|
* @internal
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memlab/api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.41",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "memlab API",
|
|
6
|
-
"author": "Liang Gong <lgong@
|
|
6
|
+
"author": "Liang Gong <lgong@meta.com>",
|
|
7
7
|
"contributors": [],
|
|
8
8
|
"keywords": [
|
|
9
9
|
"memlab",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@memlab/core": "^1.1.
|
|
31
|
-
"@memlab/e2e": "^1.0.
|
|
32
|
-
"@memlab/heap-analysis": "^1.0.
|
|
30
|
+
"@memlab/core": "^1.1.42",
|
|
31
|
+
"@memlab/e2e": "^1.0.42",
|
|
32
|
+
"@memlab/heap-analysis": "^1.0.39",
|
|
33
33
|
"ansi": "^0.3.1",
|
|
34
34
|
"babar": "^0.2.0",
|
|
35
35
|
"chalk": "^4.0.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@types/node": "^12.16.3",
|
|
49
49
|
"jest": "^29.6.2",
|
|
50
50
|
"ts-jest": "^29.1.1",
|
|
51
|
-
"typescript": "^
|
|
51
|
+
"typescript": "^5.7.2"
|
|
52
52
|
},
|
|
53
53
|
"repository": {
|
|
54
54
|
"type": "git",
|