@percy/core 1.25.0 → 1.26.0

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/config.js CHANGED
@@ -33,7 +33,12 @@ export const configSchema = {
33
33
  default: ''
34
34
  },
35
35
  enableJavaScript: {
36
- type: 'boolean'
36
+ type: 'boolean',
37
+ default: false
38
+ },
39
+ cliEnableJavaScript: {
40
+ type: 'boolean',
41
+ default: true
37
42
  },
38
43
  disableShadowDOM: {
39
44
  type: 'boolean',
@@ -197,6 +202,9 @@ export const snapshotSchema = {
197
202
  enableJavaScript: {
198
203
  $ref: '/config/snapshot#/properties/enableJavaScript'
199
204
  },
205
+ cliEnableJavaScript: {
206
+ $ref: '/config/snapshot#/properties/cliEnableJavaScript'
207
+ },
200
208
  disableShadowDOM: {
201
209
  $ref: '/config/snapshot#/properties/disableShadowDOM'
202
210
  },
package/dist/discovery.js CHANGED
@@ -24,6 +24,7 @@ function debugSnapshotOptions(snapshot) {
24
24
  debugProp(snapshot, 'widths', v => `${v}px`);
25
25
  debugProp(snapshot, 'minHeight', v => `${v}px`);
26
26
  debugProp(snapshot, 'enableJavaScript');
27
+ debugProp(snapshot, 'cliEnableJavaScript');
27
28
  debugProp(snapshot, 'disableShadowDOM');
28
29
  debugProp(snapshot, 'deviceScaleFactor');
29
30
  debugProp(snapshot, 'waitForTimeout');
@@ -301,9 +302,13 @@ export function createDiscoveryQueue(percy) {
301
302
  .handle('task', async function* (snapshot, callback) {
302
303
  percy.log.debug(`Discovering resources: ${snapshot.name}`, snapshot.meta);
303
304
 
305
+ // expectation explained in tests
306
+ /* istanbul ignore next: tested, but coverage is stripped */
307
+ let assetDiscoveryPageEnableJS = snapshot.cliEnableJavaScript && !snapshot.domSnapshot || (snapshot.enableJavaScript ?? !snapshot.domSnapshot);
308
+ percy.log.debug(`Asset discovery Browser Page enable JS: ${assetDiscoveryPageEnableJS}`);
304
309
  // create a new browser page
305
310
  let page = yield percy.browser.page({
306
- enableJavaScript: snapshot.enableJavaScript ?? !snapshot.domSnapshot,
311
+ enableJavaScript: assetDiscoveryPageEnableJS,
307
312
  networkIdleTimeout: snapshot.discovery.networkIdleTimeout,
308
313
  requestHeaders: snapshot.discovery.requestHeaders,
309
314
  authorization: snapshot.discovery.authorization,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.25.0",
3
+ "version": "1.26.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,7 +8,8 @@
8
8
  "directory": "packages/core"
9
9
  },
10
10
  "publishConfig": {
11
- "access": "public"
11
+ "access": "public",
12
+ "tag": "latest"
12
13
  },
13
14
  "engines": {
14
15
  "node": ">=14"
@@ -39,10 +40,10 @@
39
40
  "test:types": "tsd"
40
41
  },
41
42
  "dependencies": {
42
- "@percy/client": "1.25.0",
43
- "@percy/config": "1.25.0",
44
- "@percy/dom": "1.25.0",
45
- "@percy/logger": "1.25.0",
43
+ "@percy/client": "1.26.0",
44
+ "@percy/config": "1.26.0",
45
+ "@percy/dom": "1.26.0",
46
+ "@percy/logger": "1.26.0",
46
47
  "content-disposition": "^0.5.4",
47
48
  "cross-spawn": "^7.0.3",
48
49
  "extract-zip": "^2.0.1",
@@ -53,5 +54,5 @@
53
54
  "rimraf": "^3.0.2",
54
55
  "ws": "^8.0.0"
55
56
  },
56
- "gitHead": "e07723ed1b47cd34be8b13f2ad674f923e51d673"
57
+ "gitHead": "0792d3978ca2169a45e8788eba012a61f81f5159"
57
58
  }