-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sunglasses Eval #153
base: master
Are you sure you want to change the base?
Sunglasses Eval #153
Conversation
let users = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variables should be const unless you need to reassign
} else { | ||
console.log('Server is running on port', PORT); | ||
products = JSON.parse(fs.readFileSync('initial-data/products.json', 'utf-8')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use a helper function to dry this up
|
||
router.get('/api/brands/:categoryId/products', (req, res) => { | ||
const prods = products.filter((product) => product.categoryId == req.params.categoryId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use triple equals to compare both value and type
@@ -0,0 +1,36 @@ | |||
|
|||
const chai = require("chai"); | |||
const chaiHttp = require("chai-http"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is missing from your package.json
const chaiHttp = require("chai-http"); | ||
const should = chai.should(); | ||
chai.use(chaiHttp); | ||
let server = require("../server.js"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path is wrong
No description provided.