@@ -10,15 +10,15 @@ const sessionCache = {
1010 nodeMap : cache . session . nodeMap
1111 }
1212
13- function runClone ( node , compress = false ) {
14- return deepClone ( node , sessionCache , { ...options , compress } ) ;
13+ function runClone ( node ) {
14+ return deepClone ( node , sessionCache , { ...options } ) ;
1515}
1616
1717describe ( 'deepClone' , ( ) => {
1818 it ( 'clones a simple div' , ( ) => {
1919 const el = document . createElement ( 'div' ) ;
2020 el . textContent = 'hello' ;
21- const clone = runClone ( el , false ) ;
21+ const clone = runClone ( el ) ;
2222 expect ( clone ) . not . toBe ( el ) ;
2323 expect ( clone . textContent ) . toBe ( 'hello' ) ;
2424 } ) ;
@@ -32,31 +32,31 @@ describe('deepClone', () => {
3232 ctx . fillStyle = 'red' ;
3333 ctx . fillRect ( 0 , 0 , 10 , 10 ) ;
3434 }
35- const clone = runClone ( canvas , false ) ;
35+ const clone = runClone ( canvas ) ;
3636 expect ( clone . tagName ) . toBe ( 'IMG' ) ;
3737 expect ( clone . src . startsWith ( 'data:image/' ) ) . toBe ( true ) ;
3838 } ) ;
3939
4040 it ( 'deepClone handles data-capture="exclude"' , ( ) => {
4141 const el = document . createElement ( 'div' ) ;
4242 el . setAttribute ( 'data-capture' , 'exclude' ) ;
43- const clone = runClone ( el , true ) ;
43+ const clone = runClone ( el ) ;
4444 expect ( clone ) . not . toBeNull ( ) ;
4545 } ) ;
4646
4747 it ( 'deepClone handles data-capture="placeholder"' , ( ) => {
4848 const el = document . createElement ( 'div' ) ;
4949 el . setAttribute ( 'data-capture' , 'placeholder' ) ;
5050 el . setAttribute ( 'data-placeholder-text' , 'Placeholder!' ) ;
51- const clone = runClone ( el , true ) ;
51+ const clone = runClone ( el ) ;
5252 expect ( clone . textContent ) . toContain ( 'Placeholder!' ) ;
5353 } ) ;
5454
5555 it ( 'deepClone handles iframe' , ( ) => {
5656 const iframe = document . createElement ( 'iframe' ) ;
5757 iframe . width = 100 ;
5858 iframe . height = 50 ;
59- const clone = runClone ( iframe , true ) ;
59+ const clone = runClone ( iframe ) ;
6060 expect ( clone . tagName ) . toBe ( 'DIV' ) ;
6161 } ) ;
6262
@@ -75,7 +75,7 @@ describe('deepClone', () => {
7575 select . value = 'baz' ;
7676
7777 [ input , textarea , select ] . forEach ( el => {
78- const clone = runClone ( el , true ) ;
78+ const clone = runClone ( el ) ;
7979 expect ( clone . value ) . toBe ( el . value ) ;
8080 } ) ;
8181 } ) ;
@@ -86,15 +86,15 @@ describe('deepClone', () => {
8686 const span = document . createElement ( 'span' ) ;
8787 span . textContent = 'shadow' ;
8888 shadow . appendChild ( span ) ;
89- const clone = runClone ( el , true ) ;
89+ const clone = runClone ( el ) ;
9090 expect ( clone ) . not . toBeNull ( ) ;
9191 } ) ;
9292} ) ;
9393
9494describe ( 'deepClone edge cases' , ( ) => {
9595 it ( 'clones unsupported node (Comment) as a new Comment' , ( ) => {
9696 const fake = document . createComment ( 'not supported' ) ;
97- const result = runClone ( fake , true ) ;
97+ const result = runClone ( fake ) ;
9898 expect ( result . nodeType ) . toBe ( Node . COMMENT_NODE ) ;
9999 expect ( result . textContent ) . toBe ( 'not supported' ) ;
100100 expect ( result ) . not . toBe ( fake ) ;
@@ -103,7 +103,7 @@ describe('deepClone edge cases', () => {
103103 it ( 'clones attributes and children' , ( ) => {
104104 const el = document . createElement ( 'div' ) ;
105105 el . setAttribute ( 'data-test' , '1' ) ;
106- const result = runClone ( el , true ) ;
106+ const result = runClone ( el ) ;
107107 expect ( result . getAttribute ( 'data-test' ) ) . toBe ( '1' ) ;
108108 } ) ;
109109} ) ;
0 commit comments