This repository was archived by the owner on Apr 28, 2023. It is now read-only.
File tree 3 files changed +4
-9
lines changed 3 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 1
1
node_modules /
2
2
.DS_Store
3
3
npm-debug.log
4
+ cypress /videos /
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ const is = require('check-more-types')
8
8
const compare = require ( 'snap-shot-compare' )
9
9
10
10
const {
11
- isJqueryElement,
12
11
serializeDomElement,
13
12
serializeReactToHTML,
14
13
identity,
@@ -93,7 +92,7 @@ function registerCypressSnapshot () {
93
92
const devToolsLog = {
94
93
value
95
94
}
96
- if ( isJqueryElement ( $el ) ) {
95
+ if ( Cypress . dom . isJquery ( $el ) ) {
97
96
// only add DOM elements, otherwise "expected" value is enough
98
97
devToolsLog . $el = $el
99
98
}
@@ -134,7 +133,7 @@ function registerCypressSnapshot () {
134
133
}
135
134
136
135
const pickSerializer = ( asJson , value ) => {
137
- if ( isJqueryElement ( value ) ) {
136
+ if ( Cypress . dom . isJquery ( value ) ) {
138
137
return asJson ? serializeDomElement : serializeReactToHTML
139
138
}
140
139
return identity
Original file line number Diff line number Diff line change 1
1
const sd = require ( '@wildpeaks/snapshot-dom' )
2
2
const beautify = require ( 'js-beautify' ) . html
3
3
4
- function isJqueryElement ( x ) {
5
- return x && typeof x === 'object' && 'wrap' in x
6
- }
7
-
8
4
// converts DOM element to a JSON object
9
5
function serializeDomElement ( $el ) {
10
6
// console.log('snapshot value!', $el)
@@ -61,6 +57,5 @@ module.exports = {
61
57
serializeDomElement,
62
58
serializeReactToHTML,
63
59
identity,
64
- countSnapshots,
65
- isJqueryElement
60
+ countSnapshots
66
61
}
You can’t perform that action at this time.
0 commit comments