lab 11/12#4
Conversation
…ellows/callback-demo added callback demo
| @@ -0,0 +1,27 @@ | |||
| ##About | |||
| @@ -0,0 +1,24 @@ | |||
| 'use strict'; | |||
There was a problem hiding this comment.
@loomnugget Good gulpfile - remember to add, remove, or update specific pieces (or tasks) as you need them. This file is meant to help you with your specific workflow and we are totally fine with you modifying this to fit your workflow needs.
| err = createError(500, err.message); | ||
| res.status(err.status).send(err.name); | ||
| next(); | ||
| }; |
| .catch( err => Promise.reject(createError(500, err.message))); | ||
| }; | ||
|
|
||
| exports.availIDs = function(schemaName) { |
| this.color = color; | ||
| }; | ||
|
|
||
| Fruit.createFruit = function(_fruit) { |
There was a problem hiding this comment.
@loomnugget nice use of the underscore in your naming convention to differentiate the passed in fruit reference and a newly instantiated fruit - this is a great pattern.
| const fruitRouter = new Router(); | ||
|
|
||
| //posts a created list | ||
| fruitRouter.post('/api/fruit', jsonParser, function(req, res, next){ |
There was a problem hiding this comment.
@loomnugget great use of jsonParser as a middleware component here
|
|
||
| app.listen(PORT, function(){ | ||
| debug(`server up ${PORT}`); | ||
| }); |
| }); | ||
|
|
||
| it ('should respond with 404 not found', done => { | ||
| request.delete(`${url}/api/fruit/blerg`) |
There was a problem hiding this comment.
@loomnugget not sure what's going on here - testing a specific test fruit maybe?
| }); | ||
| });//end of testing valid id and body | ||
|
|
||
| it ('should respond with 400 - bad request', done => { |
| it ('should respond with 204 successful deletion', done => { | ||
| request.delete(`${url}/api/fruit/${this.tempfruit.id}`) | ||
| .end((err, res) => { | ||
| console.log(this.tempfruit.id); |
There was a problem hiding this comment.
@loomnugget this is cool for now, moving forward - use debug() or remove console.logs from your pushes on the master branch (which is considered "production") - I know we have talked about your unfamiliarity with GIT in the past, so if you would like, we can discuss this (along with some express stuff - i made a comment about this in your assignment submission) and I'll try to make GIT, branching, and a general GIT workflow not so cumbersome.
No description provided.