Jonny lab 13 & 14#8
Open
jonathanheemstra wants to merge 30 commits intocodefellows-seattle-javascript-401d12:masterfrom
Open
Jonny lab 13 & 14#8jonathanheemstra wants to merge 30 commits intocodefellows-seattle-javascript-401d12:masterfrom
jonathanheemstra wants to merge 30 commits intocodefellows-seattle-javascript-401d12:masterfrom
Conversation
scaffold files
confirmed server is up and running
setup server
add todo to all files
setup movies model
post routes working
get routes up and running
add put and delete routes
write tests
set up middleware
error middleware now handles validation and cast errors with appropriate status codes of 400 and 404 respectively.
set up error middleware
set up directors model and modify movies model
…outes set up directors routes
wrote a crazy amout of tests
kaylynyuh
reviewed
Jan 3, 2017
| }); | ||
| }); | ||
| it('should have properties of name, rating, timestamp, id, and directorID', done => { | ||
| expect(this.tempMovie).to.include.keys('name'); |
There was a problem hiding this comment.
Tests are awesome! Way to write 48 of them- totally sweet. There's a shorter way to check for all the keys, although the way you are doing it works totally fine, you could have also done something like:
expect({ foo: 1, bar: 2 }).to.have.all.keys(['bar', 'foo']);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Question:
When running my tests if I have to terminate any active servers that I am currently running. If don't then the tests will time out on the before and after hooks. Why does this happen?
Observation:
Writing two resource APIs requires that one resource is essentially the lead resource while the second resource is secondary. For instance in the case of my two resource API I needed to essentially establish the Directors collection as the primary on which all Movies (secondary collection) will be attached to. Each Director can have multiple Movies associated with them while each movie can only have one Director. I can see how when building a very large API with many more resources than 2 it would take quite a bit of planning in order to not be backed into a corner when building.