@@ -44,40 +44,37 @@ describe('execute Command', () => {
4444
4545 it ( 'should execute a stringified function' , async ( ) => {
4646 await execute ( globalThis . browser , '() => 1 + 2 + 3' ) ;
47- expect ( globalThis . browser . execute ) . toHaveBeenCalledWith ( expect . any ( Function ) , JSON . stringify ( '() => 1 + 2 + 3' ) ) ;
48- expect ( globalThis . wdioElectron . execute ) . toHaveBeenCalledWith ( JSON . stringify ( '() => 1 + 2 + 3' ) , [ ] ) ;
47+ expect ( globalThis . browser . execute ) . toHaveBeenCalledWith ( expect . any ( Function ) , '() => 1 + 2 + 3' ) ;
48+ expect ( globalThis . wdioElectron . execute ) . toHaveBeenCalledWith ( '() => 1 + 2 + 3' , [ ] ) ;
4949 } ) ;
5050
5151 it ( 'should handle scripts with quotes' , async ( ) => {
5252 const scriptWithQuotes = '() => "He said \\"hello\\""' ;
5353 await execute ( globalThis . browser , scriptWithQuotes ) ;
54- expect ( globalThis . browser . execute ) . toHaveBeenCalledWith ( expect . any ( Function ) , JSON . stringify ( scriptWithQuotes ) ) ;
54+ expect ( globalThis . browser . execute ) . toHaveBeenCalledWith ( expect . any ( Function ) , scriptWithQuotes ) ;
5555 } ) ;
5656
5757 it ( 'should handle scripts with newlines' , async ( ) => {
5858 const scriptWithNewlines = '() => "line1\\nline2"' ;
5959 await execute ( globalThis . browser , scriptWithNewlines ) ;
60- expect ( globalThis . browser . execute ) . toHaveBeenCalledWith ( expect . any ( Function ) , JSON . stringify ( scriptWithNewlines ) ) ;
60+ expect ( globalThis . browser . execute ) . toHaveBeenCalledWith ( expect . any ( Function ) , scriptWithNewlines ) ;
6161 } ) ;
6262
6363 it ( 'should handle scripts with unicode' , async ( ) => {
6464 const scriptWithUnicode = '() => "Hello 世界"' ;
6565 await execute ( globalThis . browser , scriptWithUnicode ) ;
66- expect ( globalThis . browser . execute ) . toHaveBeenCalledWith ( expect . any ( Function ) , JSON . stringify ( scriptWithUnicode ) ) ;
66+ expect ( globalThis . browser . execute ) . toHaveBeenCalledWith ( expect . any ( Function ) , scriptWithUnicode ) ;
6767 } ) ;
6868
6969 it ( 'should handle scripts with backslashes' , async ( ) => {
7070 const scriptWithBackslashes = '() => "C:\\\\path\\\\file"' ;
7171 await execute ( globalThis . browser , scriptWithBackslashes ) ;
72- expect ( globalThis . browser . execute ) . toHaveBeenCalledWith (
73- expect . any ( Function ) ,
74- JSON . stringify ( scriptWithBackslashes ) ,
75- ) ;
72+ expect ( globalThis . browser . execute ) . toHaveBeenCalledWith ( expect . any ( Function ) , scriptWithBackslashes ) ;
7673 } ) ;
7774
7875 it ( 'should handle mixed special characters' , async ( ) => {
7976 const script = '() => "Test \\n \\t \\u001b and \\\\ backslash"' ;
8077 await execute ( globalThis . browser , script ) ;
81- expect ( globalThis . browser . execute ) . toHaveBeenCalledWith ( expect . any ( Function ) , JSON . stringify ( script ) ) ;
78+ expect ( globalThis . browser . execute ) . toHaveBeenCalledWith ( expect . any ( Function ) , script ) ;
8279 } ) ;
8380} ) ;
0 commit comments