-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff! Love the simplicity of this API and the tests.
I didn't pull it down as it's a bit convoluted to test, and you've got test coverage.
I've got a few questions/#suggestions, but not really blocking.
src/tools/create-app-tester.js
Outdated
// have a storeKey when canPaginate is true. otherwise, a test would work but a | ||
// poll on site would fail. this is only used in test handlers | ||
const shouldPaginate = (appRaw, method) => { | ||
const methodParts = method.split('.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this more easily understood with method.startsWith('triggers') && method.endsWith('perform')
, then not needing last
from lodash
?
Feel free to ignore as you need the methodParts
below anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to split it anyway, but I don't like checking on the string rather than the array. good call!
src/tools/create-storekey-tool.js
Outdated
const _ = require('lodash'); | ||
const ZapierPromise = require('./promise'); | ||
|
||
// Similar API to JSON built in but catches errors with nicer tracebacks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this comment came from copy-🍝 .
test/tools/rpc-client.js
Outdated
@@ -29,4 +29,26 @@ describe('rpc client', () => { | |||
}) | |||
.catch(done); | |||
}); | |||
|
|||
it('should set a cursor key', done => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to see a test getting a cursor that doesn't exist, and setting an invalid store key (like undefined
or null
or a gigantic string), just so we can be sure failures are failing 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah! getting a cursor that hasn't been set is fine and returns null
(just like redis does). A store key missing is an error, and that behavior has a unit test on the server. I can go ahead and add something there though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having trouble testing this because since we're not actually sending any calls, nothing actually fails unless I explicitly fail it, which is then just the same. Given that there's actually a server test, i'll skip here for now.
Covers PDE-142.
This is being tested with this trigger
Note: https://github.com/zapier/zapier/pull/16646 needs to be deployed before this can be released
See linked
z/z
PR for testing info.CI is failing because it's still pointing at my local ngrok for testing reasons. I'll remove that before this is merged.