Skip to content

Commit

Permalink
Merge pull request #178 from DanielMSchmidt/code-generation
Browse files Browse the repository at this point in the history
Translate EarlGrey headers to Javascript calls
  • Loading branch information
rotemmiz authored Aug 10, 2017
2 parents fcf7689 + 175f481 commit e607fb3
Show file tree
Hide file tree
Showing 19 changed files with 1,478 additions and 36 deletions.
3 changes: 2 additions & 1 deletion detox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
"/node_modules/",
".*Driver.js",
"DeviceDriverBase.js",
"GREYConfiguration.js"
"GREYConfiguration.js",
"src/ios/earlgreyapi"
],
"resetMocks": true,
"resetModules": true,
Expand Down
3 changes: 2 additions & 1 deletion detox/src/invoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ module.exports = {
Espresso: Espresso.target,
IOS: Invoke.genericInvokeObject,
Android: Invoke.genericInvokeObject,
call: Invoke.call
call: Invoke.call,
callDirectly: Invoke.callDirectly
};
10 changes: 9 additions & 1 deletion detox/src/invoke/Invoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ function call(target, method, ...args) {
};
}

function callDirectly(json) {
return {
type: 'Invocation',
value: json
};
}

const genericInvokeObject = new Proxy({},
{
get: (target, prop) => {
Expand All @@ -36,5 +43,6 @@ const genericInvokeObject = new Proxy({},

module.exports = {
call,
genericInvokeObject
callDirectly,
genericInvokeObject,
};
Loading

0 comments on commit e607fb3

Please sign in to comment.