manning-aws-lambda-in-motion icon indicating copy to clipboard operation
manning-aws-lambda-in-motion copied to clipboard

Question about Integration Testing

Open zoomore opened this issue 7 years ago • 0 comments

Hi, thank you for your manning videos, it is a great course. I am having a trouble with integration testing in ch3 since you let the js function query the real DynamoDb and expect to return 8 restaurants. Now if I insert more restaurants I will, of course, break the test.

  • What is your thought on this?
  • Should we weaken the test and only test if more than one restaurant appear?

I guess an easy way around this would be to set up a specific stage for the integration tests but then I will rely on some kind of fixture that I will insert in the database and then run all my tests. I have always found it difficult to work with testing fixtures since changing the fixtures themselves will break most of the tests.

  • Is using fixture on a testing stage the way to go?

I think this chapter is missing a unit test video that will mock the getRestaurants function.

zoomore avatar Jul 06 '18 04:07 zoomore