@memlab/api 1.0.42 → 2.0.0

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.js CHANGED
@@ -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.testInBrowser = exports.warmup = exports.analyze = exports.findLeaksBySnapshotFilePaths = exports.findLeaks = exports.takeSnapshots = exports.run = exports.warmupAndTakeSnapshots = void 0;
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(options = {}) {
50
- return __awaiter(this, void 0, void 0, function* () {
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(options = {}) {
87
- return __awaiter(this, void 0, void 0, function* () {
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(options = {}) {
122
- return __awaiter(this, void 0, void 0, function* () {
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(runResult, options = {}) {
157
- return __awaiter(this, void 0, void 0, function* () {
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(baselineSnapshot, targetSnapshot, finalSnapshot, options = {}) {
184
- return __awaiter(this, void 0, void 0, function* () {
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(runResult, heapAnalyzer, args = { _: [] }) {
225
- return __awaiter(this, void 0, void 0, function* () {
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(options = {}) {
240
- var _a, _b;
241
- return __awaiter(this, void 0, void 0, function* () {
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(page, options = {}) {
301
- var _a, _b, _c;
302
- return __awaiter(this, void 0, void 0, function* () {
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(browser, options = {}) {
325
- var _a;
326
- return __awaiter(this, void 0, void 0, function* () {
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(options = {}) {
341
- var _a, _b;
342
- return __awaiter(this, void 0, void 0, function* () {
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;
@@ -42,7 +42,7 @@ test('Detached DOM analysis works as expected', () => __awaiter(void 0, void 0,
42
42
  let analysis = new index_1.DetachedDOMElementAnalysis();
43
43
  yield analysis.run();
44
44
  let domElems = analysis.getDetachedElements();
45
- expect(domElems.some(node => node.name === 'Detached HTMLTableElement')).toBe(true);
45
+ expect(domElems.some(node => node.name === 'Detached <table>')).toBe(true);
46
46
  // test analysis from file
47
47
  const snapshotFile = result.getSnapshotFiles().pop();
48
48
  analysis = new index_1.DetachedDOMElementAnalysis();
@@ -51,9 +51,9 @@ test('Detached DOM analysis works as expected', () => __awaiter(void 0, void 0,
51
51
  // to contain the expected results
52
52
  expect(fs_1.default.existsSync(ret.analysisOutputFile)).toBe(true);
53
53
  expect(fs_1.default
54
- .readFileSync(ret.analysisOutputFile, 'UTF-8')
55
- .includes('Detached HTMLTableElement')).toBe(true);
54
+ .readFileSync(ret.analysisOutputFile, { encoding: 'utf8' })
55
+ .includes('Detached <table>')).toBe(true);
56
56
  // check if the query result API works as expected
57
57
  domElems = analysis.getDetachedElements();
58
- expect(domElems.some(node => node.name === 'Detached HTMLTableElement')).toBe(true);
58
+ expect(domElems.some(node => node.name === 'Detached <table>')).toBe(true);
59
59
  }), E2ETestSettings_1.testTimeout);
@@ -71,7 +71,9 @@ function testAnalysisFromFileDir(result) {
71
71
  // expect the heap analysis output log file to exist and
72
72
  // to contain the expected results
73
73
  expect(fs_1.default.existsSync(ret.analysisOutputFile)).toBe(true);
74
- expect(fs_1.default.readFileSync(ret.analysisOutputFile, 'UTF-8').includes('LeakObject')).toBe(true);
74
+ expect(fs_1.default
75
+ .readFileSync(ret.analysisOutputFile, { encoding: 'utf8' })
76
+ .includes('LeakObject')).toBe(true);
75
77
  // expect the query API works
76
78
  const shapeSummary = analysis.getShapesWithUnboundGrowth();
77
79
  expect(shapeSummary.some((summary) => summary.shape.includes('LeakObject'))).toBe(true);
@@ -99,7 +101,9 @@ function testAnalysisWithSpecifiedWorkDir(result) {
99
101
  // output file is inside the working directory
100
102
  expect(path_1.default.resolve(ret.analysisOutputFile).includes(path_1.default.resolve(workDir))).toBe(true);
101
103
  // output file contains the expected result
102
- expect(fs_1.default.readFileSync(ret.analysisOutputFile, 'UTF-8').includes('LeakObject')).toBe(true);
104
+ expect(fs_1.default
105
+ .readFileSync(ret.analysisOutputFile, { encoding: 'utf8' })
106
+ .includes('LeakObject')).toBe(true);
103
107
  // expect the query API works
104
108
  const shapeSummary = analysis.getShapesWithUnboundGrowth();
105
109
  expect(shapeSummary.some((summary) => summary.shape.includes('LeakObject'))).toBe(true);
@@ -7,7 +7,7 @@
7
7
  * @format
8
8
  * @oncall memory_lab
9
9
  */
10
- import type { Page } from 'puppeteer';
10
+ import type { Page } from 'puppeteer-core';
11
11
  export declare const testTimeout: number;
12
12
  export declare const defaultAnalysisArgs: {
13
13
  args: {
@@ -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,QAAQ,IAAI,CAAC;CAE1C,CAAC;AAEF,eAAO,MAAM,SAAS,QAAO,IAK5B,CAAC;AAGF,wBAAgB,WAAW,IAAI,MAAM,CAEpC"}
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,gBAAgB,CAAC;AAGzC,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"}
@@ -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.getUniqueID = exports.testSetup = exports.scenario = exports.defaultAnalysisArgs = exports.testTimeout = void 0;
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;
@@ -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 = void 0;
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)) {
@@ -55,7 +54,7 @@ function saveSnapshotToFile(page, file) {
55
54
  captureNumericValue: true,
56
55
  });
57
56
  return new Promise((resolve, reject) => {
58
- fs_1.default.writeFile(file, heap, 'UTF-8', err => {
57
+ fs_1.default.writeFile(file, heap, { encoding: 'utf8' }, err => {
59
58
  if (err) {
60
59
  reject(err);
61
60
  }
package/dist/index.js CHANGED
@@ -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 = exports.registerPackage = void 0;
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);
@@ -7,7 +7,7 @@
7
7
  * @format
8
8
  * @oncall memory_lab
9
9
  */
10
- import type { Browser } from 'puppeteer';
10
+ import type { Browser } from 'puppeteer-core';
11
11
  import type { MemLabConfig } from '@memlab/core';
12
12
  declare function getBrowser(options?: {
13
13
  config?: MemLabConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"APIUtils.d.ts","sourceRoot":"","sources":["../../src/lib/APIUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAU/C,iBAAe,UAAU,CACvB,OAAO,GAAE;IAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAM,GACtD,OAAO,CAAC,OAAO,CAAC,CAoBlB;;;;AAED,wBAEE"}
1
+ {"version":3,"file":"APIUtils.d.ts","sourceRoot":"","sources":["../../src/lib/APIUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAU/C,iBAAe,UAAU,CACvB,OAAO,GAAE;IAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAM,GACtD,OAAO,CAAC,OAAO,CAAC,CAoBlB;;;;AAED,wBAEE"}
@@ -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(options = {}) {
28
- var _a;
29
- return __awaiter(this, void 0, void 0, function* () {
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();
@@ -1 +1 @@
1
- {"version":3,"file":"SnapshotResultReader.d.ts","sourceRoot":"","sources":["../../src/result-reader/SnapshotResultReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAS,WAAW,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AAI9D,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,gBAAgB;IAChE,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,aAAa,CAAS;IAE9B;;;;OAIG;IACH,SAAS,aACP,gBAAgB,EAAE,MAAM,EACxB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM;IAavB,OAAO,CAAC,qBAAqB;IAU7B,OAAO,CAAC,kBAAkB;IAY1B;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,aAAa,CAClB,gBAAgB,EAAE,MAAM,EACxB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,GACpB,oBAAoB;IAQvB;;OAEG;WACW,IAAI,CAAC,OAAO,SAAK,GAAG,gBAAgB;IAKlD;;;;;;;;;;;;OAYG;IACI,gBAAgB,IAAI,MAAM,EAAE;IAInC;;OAEG;IACI,kBAAkB,IAAI,MAAM;IAOnC;;;;;;;;;;;;OAYG;IACI,mBAAmB,IAAI,WAAW,EAAE;IAQ3C;;;;;;;;;;;;;OAaG;IACI,cAAc,IAAI,WAAW;IAIpC;;OAEG;IACI,OAAO,IAAI,IAAI;CAGvB"}
1
+ {"version":3,"file":"SnapshotResultReader.d.ts","sourceRoot":"","sources":["../../src/result-reader/SnapshotResultReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAS,WAAW,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AAI9D,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,gBAAgB;IAChE,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,aAAa,CAAS;IAE9B;;;;OAIG;IACH,SAAS,aACP,gBAAgB,EAAE,MAAM,EACxB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM;IAavB,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,kBAAkB;IAY1B;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,aAAa,CAClB,gBAAgB,EAAE,MAAM,EACxB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,GACpB,oBAAoB;IAQvB;;OAEG;WACW,IAAI,CAAC,OAAO,SAAK,GAAG,gBAAgB;IAKlD;;;;;;;;;;;;OAYG;IACI,gBAAgB,IAAI,MAAM,EAAE;IAInC;;OAEG;IACI,kBAAkB,IAAI,MAAM;IAOnC;;;;;;;;;;;;OAYG;IACI,mBAAmB,IAAI,WAAW,EAAE;IAQ3C;;;;;;;;;;;;;OAaG;IACI,cAAc,IAAI,WAAW;IAIpC;;OAEG;IACI,OAAO,IAAI,IAAI;CAGvB"}
@@ -54,7 +54,9 @@ class SnapshotResultReader extends BaseResultReader_1.default {
54
54
  fileManager.initDirs(core_1.config, { workDir });
55
55
  const visitOrder = this.getInteractionSteps();
56
56
  const snapSeqFile = fileManager.getSnapshotSequenceMetaFile({ workDir });
57
- fs_extra_1.default.writeFileSync(snapSeqFile, JSON.stringify(visitOrder, null, 2), 'UTF-8');
57
+ fs_extra_1.default.writeFileSync(snapSeqFile, JSON.stringify(visitOrder, null, 2), {
58
+ encoding: 'utf8',
59
+ });
58
60
  }
59
61
  checkSnapshotFiles() {
60
62
  if (!fs_extra_1.default.existsSync(this.baselineSnapshot) ||
@@ -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 = exports.ConsoleMode || (exports.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@memlab/api",
3
- "version": "1.0.42",
3
+ "version": "2.0.0",
4
4
  "license": "MIT",
5
5
  "description": "memlab API",
6
6
  "author": "Liang Gong <lgong@meta.com>",
@@ -27,16 +27,16 @@
27
27
  "access": "public"
28
28
  },
29
29
  "dependencies": {
30
- "@memlab/core": "^1.1.43",
31
- "@memlab/e2e": "^1.0.43",
32
- "@memlab/heap-analysis": "^1.0.40",
30
+ "@memlab/core": "^2.0.0",
31
+ "@memlab/e2e": "^2.0.0",
32
+ "@memlab/heap-analysis": "^2.0.0",
33
33
  "ansi": "^0.3.1",
34
34
  "babar": "^0.2.0",
35
35
  "chalk": "^4.0.0",
36
36
  "fs-extra": "^4.0.2",
37
37
  "minimist": "^1.2.8",
38
- "puppeteer": "^22.12.1",
39
- "puppeteer-core": "^22.12.1",
38
+ "puppeteer": "^24.2.0",
39
+ "puppeteer-core": "^24.2.0",
40
40
  "string-width": "^4.2.0",
41
41
  "util.promisify": "^1.1.1",
42
42
  "xvfb": "^0.4.0"
@@ -45,10 +45,10 @@
45
45
  "@types/fs-extra": "^9.0.3",
46
46
  "@types/jest": "^27.4.1",
47
47
  "@types/minimist": "^1.2.5",
48
- "@types/node": "^12.16.3",
48
+ "@types/node": "^25.0.0",
49
49
  "jest": "^29.6.2",
50
50
  "ts-jest": "^29.1.1",
51
- "typescript": "^5.7.2"
51
+ "typescript": "^5.9.3"
52
52
  },
53
53
  "repository": {
54
54
  "type": "git",