memlab 1.1.10-alpha → 1.1.13-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 +3 -1
- package/bin/memlab +1 -1
- package/bin/preinstall +23 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -25,11 +25,13 @@ function url() {
|
|
|
25
25
|
|
|
26
26
|
// action where we want to detect memory leaks: click the Hotels button
|
|
27
27
|
async function action(page) {
|
|
28
|
+
// puppeteer page API
|
|
28
29
|
await page.click('button[aria-label="Hotels"]');
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
// action where we want to go back to the step before: click clear search
|
|
32
33
|
async function back(page) {
|
|
34
|
+
// puppeteer page API
|
|
33
35
|
await page.click('[aria-label="Clear search"]');
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -97,4 +99,4 @@ const scenario = {
|
|
|
97
99
|
back: async (page) => await page.click('[aria-label="Clear search"]'),
|
|
98
100
|
}
|
|
99
101
|
memlab.run({scenario});
|
|
100
|
-
```
|
|
102
|
+
```
|
package/bin/memlab
CHANGED
package/bin/preinstall
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* @emails oncall+ws_labs
|
|
10
|
+
* @format
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const path = require("path");
|
|
14
|
+
const fs = require("fs");
|
|
15
|
+
if (process.platform !== "win32") {
|
|
16
|
+
const memlabFile = path.join(__dirname, "../bin/memlab");
|
|
17
|
+
const content = fs.readFileSync(memlabFile, "UTF-8");
|
|
18
|
+
fs.writeFileSync(
|
|
19
|
+
memlabFile,
|
|
20
|
+
content.replace("#!/usr/bin/env node", "#!/usr/bin/env -S node"),
|
|
21
|
+
"UTF-8"
|
|
22
|
+
);
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memlab",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.13-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",
|
|
7
7
|
"files": [
|
|
8
|
-
"dist"
|
|
8
|
+
"dist",
|
|
9
|
+
"bin"
|
|
9
10
|
],
|
|
10
11
|
"bin": {
|
|
11
12
|
"memlab": "bin/memlab"
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
"typescript": "^4.6.3"
|
|
51
52
|
},
|
|
52
53
|
"scripts": {
|
|
54
|
+
"preinstall": "node bin/preinstall",
|
|
53
55
|
"build-pkg": "tsc",
|
|
54
56
|
"clean-pkg": "rm -rf ./dist && rm -rf ./node_modules && rm -f ./tsconfig.tsbuildinfo"
|
|
55
57
|
},
|