jesscjess / TDD-final-project

0 stars 0 forks source link

Congrats! #1

Open Axkaban opened 6 years ago

Axkaban commented 6 years ago

Really good job, it is all above the expectations! For a moment I forgot you were using mongoose and I got thrown off by your findById() method in your videos.js routes, I couldn't find it anywhere! lol Then I look at your models and it clicked. Great job using the tools you already have: https://github.com/jtcjara/TDD-final-project/blob/master/routes/videos.js#L38

Another approach, that it might be helpful for the other requests would be creating your own functions in the file like this one:

const findVideo = async (request) => {
  const {id} = request.params;

  return await Video.findOne({ _id: id });
}```

and if you wanted a function to build and pass the video information you can create one like this:

const buildVideo = (video, {title, description, url}) => { video.title = title; video.description = description; video.url = url;

video.validateSync(); };```

Then again, it is not necessary and your execution was good!

ON THE TESTS

Well put together! although I did not see one for updating and one for deleting videos.

Again, great job!

jesscjess commented 6 years ago

Thanks! Yeah I didn't totally finish :/ but wanted to submit what I had before the final deadline lol. I really enjoyed the course, I learnt a lot that I can apply right away.

I haven't gone back to look at it but at the time I really couldn't get the test to check for iFrames to work. Can you show me a solution please?