memlab 1.0.1-alpha → 1.0.5-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.
Files changed (2) hide show
  1. package/README.md +24 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -13,10 +13,32 @@ Install the CLI
13
13
  npm install -g @memlab
14
14
  ```
15
15
 
16
- Find memory leaks in Google Maps:
16
+ To find memory leaks in Google Maps, create a scenario file defining how
17
+ we want to interact with the Google Maps, let's name it `test-google-maps.js`:
18
+
19
+ ```javascript
20
+ // Visit Google Maps
21
+ function url() {
22
+ return 'https://www.google.com/maps/@37.386427,-122.0428214,11z';
23
+ }
24
+
25
+ // action where we want to detect memory leaks: click the Hotels button
26
+ async function action(page) {
27
+ await page.click('button[aria-label="Hotels"]');
28
+ }
29
+
30
+ // action where we want to go back to the step before: click clear search
31
+ async function back(page) {
32
+ await page.click('[aria-label="Clear search"]');
33
+ }
34
+
35
+ module.exports = {action, back, url};
36
+ ```
37
+
38
+ Now run memlab with the scenario file, memlab will interaction with
39
+ the web page and show detected memory leaks:
17
40
 
18
41
  ```bash
19
- wget -q -O test-google-maps.js https://tinyurl.com/4yr5watu
20
42
  memlab run --scenario test-google-maps.js
21
43
  ```
22
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memlab",
3
- "version": "1.0.1-alpha",
3
+ "version": "1.0.5-alpha",
4
4
  "license": "MIT",
5
5
  "description": "memlab is a framework that analyzes memory and finds memory leaks in JavaScript applications.",
6
6
  "main": "dist/index.js",