@memlab/api 1.0.41 → 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.
@@ -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,OAAO,CAAC,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"}
@@ -54,7 +54,7 @@ function saveSnapshotToFile(page, file) {
54
54
  captureNumericValue: true,
55
55
  });
56
56
  return new Promise((resolve, reject) => {
57
- fs_1.default.writeFile(file, heap, 'UTF-8', err => {
57
+ fs_1.default.writeFile(file, heap, { encoding: 'utf8' }, err => {
58
58
  if (err) {
59
59
  reject(err);
60
60
  }
@@ -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,g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AO,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) ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memlab/api",
3
- "version": "1.0.41",
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.42",
31
- "@memlab/e2e": "^1.0.42",
32
- "@memlab/heap-analysis": "^1.0.39",
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",