memlab 1.0.2-alpha → 1.0.6-alpha
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/README.md +27 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# memlab
|
|
2
2
|
|
|
3
|
-
memlab is an E2E testing and analysis framework for finding memory
|
|
4
|
-
in
|
|
5
|
-
|
|
6
|
-
and Electron.js.
|
|
3
|
+
memlab is an E2E testing and analysis framework for finding JavaScript memory
|
|
4
|
+
leaks in Chromium. The CLI Toolbox and library provide extensible interfaces
|
|
5
|
+
for analyzing heap snapshots taken from Chrome/Chromium, Node.js, Hermes, and Electron.js.
|
|
7
6
|
|
|
8
7
|
## CLI Usage
|
|
9
8
|
|
|
@@ -13,10 +12,32 @@ Install the CLI
|
|
|
13
12
|
npm install -g @memlab
|
|
14
13
|
```
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
To find memory leaks in Google Maps, create a scenario file defining how
|
|
16
|
+
we want to interact with the Google Maps, let's name it `test-google-maps.js`:
|
|
17
|
+
|
|
18
|
+
```javascript
|
|
19
|
+
// Visit Google Maps
|
|
20
|
+
function url() {
|
|
21
|
+
return 'https://www.google.com/maps/@37.386427,-122.0428214,11z';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// action where we want to detect memory leaks: click the Hotels button
|
|
25
|
+
async function action(page) {
|
|
26
|
+
await page.click('button[aria-label="Hotels"]');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// action where we want to go back to the step before: click clear search
|
|
30
|
+
async function back(page) {
|
|
31
|
+
await page.click('[aria-label="Clear search"]');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
module.exports = {action, back, url};
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Now run memlab with the scenario file, memlab will interaction with
|
|
38
|
+
the web page and show detected memory leaks:
|
|
17
39
|
|
|
18
40
|
```bash
|
|
19
|
-
wget -q -O test-google-maps.js https://tinyurl.com/4yr5watu
|
|
20
41
|
memlab run --scenario test-google-maps.js
|
|
21
42
|
```
|
|
22
43
|
|