@percy/sdk-utils 1.32.0-beta.5 → 1.32.0-beta.7

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/dist/bundle.js CHANGED
@@ -392,11 +392,14 @@
392
392
  `;
393
393
  }
394
394
 
395
- // For page.evaluate (auto-await Promises)
395
+ // For page.evaluate (auto-awaits the returned Promise). This MUST be a single
396
+ // expression: page.evaluate(string) evaluates the string as a script, where a
397
+ // top-level `return` is a SyntaxError ("Illegal return statement"). A ternary
398
+ // expression yields the waitForReady Promise (auto-awaited) or undefined.
396
399
  return `
397
- if (typeof PercyDOM !== 'undefined' && typeof PercyDOM.waitForReady === 'function') {
398
- return PercyDOM.waitForReady(${config});
399
- }
400
+ (typeof PercyDOM !== 'undefined' && typeof PercyDOM.waitForReady === 'function')
401
+ ? PercyDOM.waitForReady(${config})
402
+ : undefined
400
403
  `;
401
404
  }
402
405
 
@@ -76,11 +76,14 @@ function waitForReadyScript(readinessConfig = {}, {
76
76
  `;
77
77
  }
78
78
 
79
- // For page.evaluate (auto-await Promises)
79
+ // For page.evaluate (auto-awaits the returned Promise). This MUST be a single
80
+ // expression: page.evaluate(string) evaluates the string as a script, where a
81
+ // top-level `return` is a SyntaxError ("Illegal return statement"). A ternary
82
+ // expression yields the waitForReady Promise (auto-awaited) or undefined.
80
83
  return `
81
- if (typeof PercyDOM !== 'undefined' && typeof PercyDOM.waitForReady === 'function') {
82
- return PercyDOM.waitForReady(${config});
83
- }
84
+ (typeof PercyDOM !== 'undefined' && typeof PercyDOM.waitForReady === 'function')
85
+ ? PercyDOM.waitForReady(${config})
86
+ : undefined
84
87
  `;
85
88
  }
86
89
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/sdk-utils",
3
- "version": "1.32.0-beta.5",
3
+ "version": "1.32.0-beta.7",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -54,5 +54,5 @@
54
54
  "dependencies": {
55
55
  "pac-proxy-agent": "^7.0.2"
56
56
  },
57
- "gitHead": "d93415f2cc83533c9c037579e440c6e2a5119920"
57
+ "gitHead": "9f25a93344237c69c9b0d104de0208857d4c8981"
58
58
  }