@percy/core 1.31.4 → 1.31.5-beta.1

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/api.js CHANGED
@@ -118,7 +118,7 @@ export function createPercyServer(percy, port) {
118
118
  .route('get', '/percy-agent.js', async (req, res) => {
119
119
  logger('core:server').deprecated(['It looks like you’re using @percy/cli with an older SDK.', 'Please upgrade to the latest version to fix this warning.', 'See these docs for more info: https://www.browserstack.com/docs/percy/migration/migrate-to-cli'].join(' '));
120
120
  let content = await fs.promises.readFile(PERCY_DOM, 'utf-8');
121
- let wrapper = '(window.PercyAgent = class { snapshot(n, o) { return PercyDOM.serialize(o); } });';
121
+ let wrapper = '(window.PercyAgent = class { async snapshot(n, o) { return await PercyDOM.serialize(o); } });';
122
122
  return res.send(200, 'application/javascript', content.concat(wrapper));
123
123
  })
124
124
  // post one or more snapshots, optionally async
package/dist/page.js CHANGED
@@ -213,15 +213,18 @@ export class Page {
213
213
  await this.network.idle();
214
214
  await this.insertPercyDom();
215
215
 
216
- // serialize and capture a DOM snapshot
216
+ // serialize and capture a DOM snapshot (async)
217
217
  this.log.debug('Serialize DOM', this.meta);
218
218
 
219
219
  /* istanbul ignore next: no instrumenting injected code */
220
- let capture = await this.eval((_, options) => ({
221
- /* eslint-disable-next-line no-undef */
222
- domSnapshot: PercyDOM.serialize(options),
223
- url: document.URL
224
- }), {
220
+ let capture = await this.eval(async (_, options) => {
221
+ /* eslint-disable no-undef */
222
+ return {
223
+ domSnapshot: await PercyDOM.serialize(options),
224
+ url: document.URL
225
+ };
226
+ /* eslint-enable no-undef */
227
+ }, {
225
228
  enableJavaScript,
226
229
  disableShadowDOM,
227
230
  forceShadowAsLightDOM,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.31.4",
3
+ "version": "1.31.5-beta.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public",
12
- "tag": "latest"
12
+ "tag": "beta"
13
13
  },
14
14
  "engines": {
15
15
  "node": ">=14"
@@ -43,12 +43,12 @@
43
43
  "test:types": "tsd"
44
44
  },
45
45
  "dependencies": {
46
- "@percy/client": "1.31.4",
47
- "@percy/config": "1.31.4",
48
- "@percy/dom": "1.31.4",
49
- "@percy/logger": "1.31.4",
50
- "@percy/monitoring": "1.31.4",
51
- "@percy/webdriver-utils": "1.31.4",
46
+ "@percy/client": "1.31.5-beta.1",
47
+ "@percy/config": "1.31.5-beta.1",
48
+ "@percy/dom": "1.31.5-beta.1",
49
+ "@percy/logger": "1.31.5-beta.1",
50
+ "@percy/monitoring": "1.31.5-beta.1",
51
+ "@percy/webdriver-utils": "1.31.5-beta.1",
52
52
  "content-disposition": "^0.5.4",
53
53
  "cross-spawn": "^7.0.3",
54
54
  "extract-zip": "^2.0.1",
@@ -61,5 +61,5 @@
61
61
  "ws": "^8.17.1",
62
62
  "yaml": "^2.4.1"
63
63
  },
64
- "gitHead": "ae9af7043b17186a26e4b8c584faa45559260f9e"
64
+ "gitHead": "074c9bfd98f79d863b3375bff9d72602cff2798d"
65
65
  }