Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Sunglasses Eval #153

wants to merge 6 commits into from

Conversation

kelseyb55
Copy link

No description provided.

let users = [];
Copy link

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'));
Copy link

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);
Copy link

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");
Copy link

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");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path is wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants