Skip to content

Chris d'Arcy Node Eval#178

Open
cmdarcy wants to merge 20 commits intoprojectshft:masterfrom
cmdarcy:master
Open

Chris d'Arcy Node Eval#178
cmdarcy wants to merge 20 commits intoprojectshft:masterfrom
cmdarcy:master

Conversation

@cmdarcy
Copy link

@cmdarcy cmdarcy commented Apr 13, 2025

No description provided.

// create constants for tests
const validUser = { userName: 'yellowleopard753', password: 'jonjon' };
const user = users.find((u) => u.login.username === validUser.userName);
const invalidUsers = [

Choose a reason for hiding this comment

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

always include the word mock as these are not real

Suggested change
const invalidUsers = [
const invalidUsersMock = [

{ password: 'valid' },
{},
];
const incorrectUsers = [

Choose a reason for hiding this comment

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

spacing

describe('/GET brands/:brandId/products', () => {
it('should respond with 404 status when the supplied brand does not exist', (done) => {
const brandId = '7';

Choose a reason for hiding this comment

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

space

});
});

it('should treat an empty searchTerm the same as not supplying one', (done) => {

Choose a reason for hiding this comment

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

not clear statement

res.should.have.status(200);
res.body.should.be.an('array');
res.body.should.not.be.empty;
res.body[0].should.have.all.keys(

Choose a reason for hiding this comment

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

you are not really testing here the search functionality, you need to make sure the actual data is correct

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