@percy/core 1.30.3-beta.0 → 1.30.3-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 +1 -1
- package/dist/snapshot.js +6 -3
- package/dist/utils.js +12 -1
- package/package.json +7 -7
package/dist/api.js
CHANGED
|
@@ -180,7 +180,7 @@ export function createPercyServer(percy, port) {
|
|
|
180
180
|
data: data
|
|
181
181
|
});
|
|
182
182
|
})
|
|
183
|
-
//
|
|
183
|
+
// Receives events from sdk's.
|
|
184
184
|
.route('post', '/percy/events', async (req, res) => {
|
|
185
185
|
var _percy$build2;
|
|
186
186
|
const body = percyBuildEventHandler(req, pkg.version);
|
package/dist/snapshot.js
CHANGED
|
@@ -3,7 +3,7 @@ import PercyConfig from '@percy/config';
|
|
|
3
3
|
import micromatch from 'micromatch';
|
|
4
4
|
import { configSchema } from './config.js';
|
|
5
5
|
import Queue from './queue.js';
|
|
6
|
-
import { request, hostnameMatches, yieldTo, snapshotLogName, decodeAndEncodeURLWithLogging } from './utils.js';
|
|
6
|
+
import { request, hostnameMatches, yieldTo, snapshotLogName, decodeAndEncodeURLWithLogging, compareObjectTypes } from './utils.js';
|
|
7
7
|
import { JobData } from './wait-for-job.js';
|
|
8
8
|
|
|
9
9
|
// Throw a better error message for missing or invalid urls
|
|
@@ -420,8 +420,11 @@ export function createSnapshotsQueue(percy) {
|
|
|
420
420
|
// snapshots are unique by name and testCase both
|
|
421
421
|
.handle('find', ({
|
|
422
422
|
name,
|
|
423
|
-
testCase
|
|
424
|
-
|
|
423
|
+
testCase,
|
|
424
|
+
tag
|
|
425
|
+
}, snapshot) => {
|
|
426
|
+
return snapshot.testCase === testCase && snapshot.name === name && compareObjectTypes(tag, snapshot.tag);
|
|
427
|
+
})
|
|
425
428
|
// when pushed, maybe flush old snapshots or possibly merge with existing snapshots
|
|
426
429
|
.handle('push', (snapshot, existing) => {
|
|
427
430
|
let {
|
package/dist/utils.js
CHANGED
|
@@ -515,4 +515,15 @@ export class DefaultMap extends Map {
|
|
|
515
515
|
return super.get(key);
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
|
-
;
|
|
518
|
+
;
|
|
519
|
+
export function compareObjectTypes(obj1, obj2) {
|
|
520
|
+
if (obj1 === obj2) return true; // Handles primitives
|
|
521
|
+
if (typeof obj1 !== 'object' || typeof obj2 !== 'object' || obj1 === null || obj2 === null) return false;
|
|
522
|
+
const keys1 = Object.keys(obj1);
|
|
523
|
+
const keys2 = Object.keys(obj2);
|
|
524
|
+
if (keys1.length !== keys2.length) return false;
|
|
525
|
+
for (const key of keys1) {
|
|
526
|
+
if (!keys2.includes(key) || !compareObjectTypes(obj1[key], obj2[key])) return false;
|
|
527
|
+
}
|
|
528
|
+
return true;
|
|
529
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/core",
|
|
3
|
-
"version": "1.30.3-beta.
|
|
3
|
+
"version": "1.30.3-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"test:types": "tsd"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@percy/client": "1.30.3-beta.
|
|
47
|
-
"@percy/config": "1.30.3-beta.
|
|
48
|
-
"@percy/dom": "1.30.3-beta.
|
|
49
|
-
"@percy/logger": "1.30.3-beta.
|
|
50
|
-
"@percy/webdriver-utils": "1.30.3-beta.
|
|
46
|
+
"@percy/client": "1.30.3-beta.1",
|
|
47
|
+
"@percy/config": "1.30.3-beta.1",
|
|
48
|
+
"@percy/dom": "1.30.3-beta.1",
|
|
49
|
+
"@percy/logger": "1.30.3-beta.1",
|
|
50
|
+
"@percy/webdriver-utils": "1.30.3-beta.1",
|
|
51
51
|
"content-disposition": "^0.5.4",
|
|
52
52
|
"cross-spawn": "^7.0.3",
|
|
53
53
|
"extract-zip": "^2.0.1",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"ws": "^8.17.1",
|
|
61
61
|
"yaml": "^2.4.1"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "ef0d87e52a4010b4a59eb5e0161319826f34f97b"
|
|
64
64
|
}
|