File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ function mapArgument(argument: any, index: number): any {
15
15
: argument
16
16
}
17
17
18
- const mockFnToExecuteInPage = `
18
+ const delegateFnToExecuteInPage = `
19
19
function evaluateInPage(container, fnName, ...args) {
20
20
${ domLibraryAsString }
21
21
@@ -59,9 +59,9 @@ function createDelegateFor(
59
59
) : ( ...args : any [ ] ) => Promise < DOMReturnType > {
60
60
return async function ( ...args : any [ ] ) : Promise < DOMReturnType > {
61
61
// @ts -ignore
62
- const containerHandle : ElementHandle = contextFn ? contextFn ( ... args ) : this
62
+ const containerHandle : ElementHandle = contextFn ? contextFn . apply ( this , args ) : this
63
63
// @ts -ignore
64
- const evaluateFn : EvaluateFn = { toString : ( ) => mockFnToExecuteInPage }
64
+ const evaluateFn : EvaluateFn = { toString : ( ) => delegateFnToExecuteInPage }
65
65
66
66
// Convert RegExp to a special format since they don't serialize well
67
67
let argsToForward = args . map ( arg => ( arg instanceof RegExp ? { regex : arg . source } : arg ) )
You can’t perform that action at this time.
0 commit comments