IntegTest ExpectedResult : How to test for an empty array? #29300
Unanswered
jvalore-medallia
asked this question in
Q&A
Replies: 1 comment
-
Digging in to the behavior, it looks like the I added a unit test for it
which then fails
Which is unfortunate. I guess the best that can be done at the moment is to test if update Well you also can't test for
results in the error
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Testing the response of a Lambda in an IntegTest, and if it returns some data, then
assertAtPath
works correctly like this:From the CloudWatch logs for the SingletonFunction, I get:
The Lambda returns:
and the integ test runner forwards the paths
That works well 🎉
However if My lambda was to return
data: []
then I am struggling to figure out how to test that...I tried:
but that does not work. It seems like it doesn't even pull the data (empty array) off the
path
properly?From the CloudWatch logs again:
The
outputPaths
appears to be set correctly.The Lambda returns:
But
[]
is not plucked fromPayload.data
, instead it is ... undefined? non existant?and my test fails.
It seems like something should have been returned for that path, but 🤷
What is the correct way to test for an empty array? Or is this just a bug?
Beta Was this translation helpful? Give feedback.
All reactions