@memlab/api 1.0.16 → 1.0.17

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.
@@ -17,8 +17,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
17
17
  step((generator = generator.apply(thisArg, _arguments || [])).next());
18
18
  });
19
19
  };
20
+ var __importDefault = (this && this.__importDefault) || function (mod) {
21
+ return (mod && mod.__esModule) ? mod : { "default": mod };
22
+ };
20
23
  Object.defineProperty(exports, "__esModule", { value: true });
21
24
  /* eslint-disable @typescript-eslint/ban-ts-comment */
25
+ const fs_1 = __importDefault(require("fs"));
22
26
  const index_1 = require("../../index");
23
27
  const E2ETestSettings_1 = require("./lib/E2ETestSettings");
24
28
  beforeEach(E2ETestSettings_1.testSetup);
@@ -42,7 +46,14 @@ test('Detached DOM analysis works as expected', () => __awaiter(void 0, void 0,
42
46
  // test analysis from file
43
47
  const snapshotFile = result.getSnapshotFiles().pop();
44
48
  analysis = new index_1.DetachedDOMElementAnalysis();
45
- yield analysis.analyzeSnapshotFromFile(snapshotFile);
49
+ const ret = yield analysis.analyzeSnapshotFromFile(snapshotFile);
50
+ // expect the heap analysis output log file to exist and
51
+ // to contain the expected results
52
+ expect(fs_1.default.existsSync(ret.analysisOutputFile)).toBe(true);
53
+ expect(fs_1.default
54
+ .readFileSync(ret.analysisOutputFile, 'UTF-8')
55
+ .includes('Detached HTMLTableElement')).toBe(true);
56
+ // check if the query result API works as expected
46
57
  domElems = analysis.getDetachedElements();
47
58
  expect(domElems.some(node => node.name === 'Detached HTMLTableElement')).toBe(true);
48
59
  }), E2ETestSettings_1.testTimeout);
@@ -17,8 +17,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
17
17
  step((generator = generator.apply(thisArg, _arguments || [])).next());
18
18
  });
19
19
  };
20
+ var __importDefault = (this && this.__importDefault) || function (mod) {
21
+ return (mod && mod.__esModule) ? mod : { "default": mod };
22
+ };
20
23
  Object.defineProperty(exports, "__esModule", { value: true });
21
24
  /* eslint-disable @typescript-eslint/ban-ts-comment */
25
+ const fs_1 = __importDefault(require("fs"));
22
26
  const index_1 = require("../../index");
23
27
  const E2ETestSettings_1 = require("./lib/E2ETestSettings");
24
28
  beforeEach(E2ETestSettings_1.testSetup);
@@ -53,7 +57,12 @@ test('Shape unbound analysis works as expected', () => __awaiter(void 0, void 0,
53
57
  // test analysis from file
54
58
  const snapshotDir = result.getSnapshotFileDir();
55
59
  analysis = new index_1.ShapeUnboundGrowthAnalysis();
56
- yield analysis.analyzeSnapshotsInDirectory(snapshotDir);
60
+ const ret = yield analysis.analyzeSnapshotsInDirectory(snapshotDir);
61
+ // expect the heap analysis output log file to exist and
62
+ // to contain the expected results
63
+ expect(fs_1.default.existsSync(ret.analysisOutputFile)).toBe(true);
64
+ expect(fs_1.default.readFileSync(ret.analysisOutputFile, 'UTF-8').includes('LeakObject')).toBe(true);
65
+ // expect the query API works
57
66
  shapeSummary = analysis.getShapesWithUnboundGrowth();
58
67
  expect(shapeSummary.some((summary) => summary.shape.includes('LeakObject'))).toBe(true);
59
68
  // expect incorrect use of heap analysis to throw
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memlab/api",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "license": "MIT",
5
5
  "description": "memlab API",
6
6
  "author": "Liang Gong <lgong@fb.com>",
@@ -58,7 +58,7 @@
58
58
  "scripts": {
59
59
  "build-pkg": "tsc",
60
60
  "test-pkg": "jest .",
61
- "publish-patch": "npm version patch --force && npm publish",
61
+ "publish-patch": "npm publish",
62
62
  "clean-pkg": "rm -rf ./dist && rm -rf ./node_modules && rm -f ./tsconfig.tsbuildinfo"
63
63
  },
64
64
  "bugs": {