@checksum-ai/runtime 1.0.38 → 1.0.39

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/package.json +1 -1
  2. package/postinstall.js +25 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checksum-ai/runtime",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "description": "Checksum.ai test runtime",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/postinstall.js CHANGED
@@ -23,26 +23,32 @@ try {
23
23
  console.log("Failed adding checksum scripts to package.json, ", e);
24
24
  }
25
25
 
26
- try {
27
- function installPlaywright() {
28
- return new Promise((resolve, reject) => {
29
- exec("npx playwright install", (error, stdout, stderr) => {
30
- if (error) {
31
- reject(`Error: ${error.message}`);
32
- return;
33
- }
34
- if (stderr) {
35
- reject(`Stderr: ${stderr}`);
36
- return;
37
- }
38
- resolve(stdout);
26
+ async function installPlaywright() {
27
+ try {
28
+ function run() {
29
+ return new Promise((resolve, reject) => {
30
+ exec("npx playwright install", (error, stdout, stderr) => {
31
+ if (error) {
32
+ reject(`Error: ${error.message}`);
33
+ return;
34
+ }
35
+ if (stderr) {
36
+ reject(`Stderr: ${stderr}`);
37
+ return;
38
+ }
39
+ resolve(stdout);
40
+ });
39
41
  });
40
- });
42
+ }
43
+
44
+ console.log("Installing playwright");
45
+ await run();
46
+ console.log("Playwright installed successfully");
47
+ } catch (e) {
48
+ console.error("Playwright installation failed", error);
41
49
  }
50
+ }
42
51
 
43
- console.log("Installing playwright");
52
+ (async () => {
44
53
  await installPlaywright();
45
- console.log("Playwright installed successfully");
46
- } catch (e) {
47
- console.error("Playwright installation failed", error);
48
- }
54
+ })();