Skip to content

Commit

Permalink
remove unused deps and code
Browse files Browse the repository at this point in the history
  • Loading branch information
datashard committed Dec 8, 2023
1 parent 1fe4562 commit e2ef978
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,8 @@
},
"dependencies": {
"@wildpeaks/snapshot-dom": "1.6.0",
"chai": "4.3.10",
"check-more-types": "2.24.0",
"js-beautify": "1.13.13",
"jsondiffpatch": "0.5.0",
"lazy-ass": "1.6.0",
"snap-shot-compare": "3.0.0",
"snap-shot-store": "1.2.3"
"lazy-ass": "1.6.0"
}
}
17 changes: 4 additions & 13 deletions src/utils/snapshots/snapshot.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const serializeDomElement = require("../serializers/serializeDomElement");
const serializeToHTML = require("../serializers/serializeToHTML");
const compareValues = require("./compareValues");
const { initStore } = require("snap-shot-store");
const path = require("path");
const identity = (x) => x;

Expand All @@ -12,11 +11,7 @@ const pickSerializer = (asJson, value) => {
return identity;
};

const newStore = (name) => {
return initStore(name);
};

const store_snapshot = (store, props = { value, name, path, raiser }) => {
const store_snapshot = (props = { value, name, path, raiser }) => {
const expectedPath = path.join(
props.path ||
Cypress.config("snapshot").snapshotPath ||
Expand All @@ -33,11 +28,8 @@ const store_snapshot = (store, props = { value, name, path, raiser }) => {
};

const set_snapshot = (
store,
{ snapshotName, snapshotPath, serialized, value }
) => {
if (!store) return;

let devToolsLog = { $el: serialized };

if (Cypress.dom.isJquery(value)) {
Expand Down Expand Up @@ -81,7 +73,7 @@ const set_snapshot = (
};
Cypress.log(options);

store_snapshot(store, {
store_snapshot({
value,
name: snapshotName,
path: snapshotPath,
Expand All @@ -106,9 +98,8 @@ module.exports = (value, step, options) => {

const serializer = pickSerializer(options.json, value);
const serialized = serializer(value);
const store = newStore(serialized || {});

set_snapshot(store, {

set_snapshot({
snapshotName: get_snapshot_name(
Cypress.currentTest,
options.snapshotName || step
Expand Down

0 comments on commit e2ef978

Please sign in to comment.