# NODE JS vidly : GET / in genres.test.js does not pass.( picture attached)

**URL:** <https://forum.codewithmosh.com/t/node-js-vidly-get-in-genres-test-js-does-not-pass-picture-attached/150>\
**Category:** Node\
**Created:** [October 24, 2020, 8:50am UTC](https://forum.codewithmosh.com/t/node-js-vidly-get-in-genres-test-js-does-not-pass-picture-attached/150 "2020-10-24T08:50:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChauPham90](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@ChauPham90](https://forum.codewithmosh.com/u/ChauPham90)\
**Post date:** [October 24, 2020, 8:50am UTC](https://forum.codewithmosh.com/t/node-js-vidly-get-in-genres-test-js-does-not-pass-picture-attached/150/1 "2020-10-24T08:50:11Z")

</div>

![Screenshot (1)](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/1X/fcff987b6b7b17c9e38755c200c5afa7b2502e70.png)

I am at **Intergration Test** ,

> ```
> > > describe('GET /', () => {
> 
> ```
> 
> > > ```
> > > it('should return all genres', async () => {
> > > const genres = [
> > > { name: 'genre1' },
> > > { name: 'genre2' },
> > > ];
> > > 
> > > ```
> 
> ```
> await Genre.collection.insertMany(genres);
> 
> const res = await request(server).get('/api/genres');
>                   
> expect(res.status).toBe(200);
> expect(res.body.length).toBe(2);
> expect(res.body.some(g => g.name === 'genre1')).toBeTruthy();
> expect(res.body.some(g => g.name === 'genre2')).toBeTruthy();
> });
> }); 
> 
> ```

in genres.test.js does not pass.Preformatted text

when I check MongoDB compass, there are only 2 genres in collection.

I try to download the sample code from Mosh, It also does not pass ( I attached picture), someone face the same problem? have any idea to solve it?

thank in advance.

---

<div class="post-metadata">

**Author:** ![agomesd](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@agomesd](https://forum.codewithmosh.com/u/agomesd)\
**Post date:** [January 19, 2021, 8:56am UTC](https://forum.codewithmosh.com/t/node-js-vidly-get-in-genres-test-js-does-not-pass-picture-attached/150/2 "2021-01-19T08:56:54Z")

</div>

Hi, I’m getting a similar error but mine fails at the first expect(res.status).toBe(200) line. Heres a screenshot :

 ![Screenshot 2021-01-19 at 09.53.14](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/1X/ce295ac1e5bf55d62b0cc473712547b26f0e5f17.png)

I cant seem to figure it out.

---

<div class="post-metadata">

**Author:** ![agomesd](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@agomesd](https://forum.codewithmosh.com/u/agomesd)\
**Post date:** [January 22, 2021, 10:04am UTC](https://forum.codewithmosh.com/t/node-js-vidly-get-in-genres-test-js-does-not-pass-picture-attached/150/3 "2021-01-22T10:04:12Z")

</div>

Figured it out, had bufferCommands set to false.

---

<div class="post-metadata">

**Author:** ![Vlad](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/vlad/32/1133_2.png) [@Vlad](https://forum.codewithmosh.com/u/Vlad)\
**Post date:** [March 14, 2021, 11:46am UTC](https://forum.codewithmosh.com/t/node-js-vidly-get-in-genres-test-js-does-not-pass-picture-attached/150/5 "2021-03-14T11:46:30Z")

</div>

Hi,

Where exactly did you set this option?  
I have the same problem and I can’t figure it out.

Thank you

---

<div class="post-metadata">

**Author:** ![agomesd](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@agomesd](https://forum.codewithmosh.com/u/agomesd)\
**Post date:** [March 16, 2021, 4:04pm UTC](https://forum.codewithmosh.com/t/node-js-vidly-get-in-genres-test-js-does-not-pass-picture-attached/150/6 "2021-03-16T16:04:34Z")

</div>

Hi Vlad,

it was set in the mongodb call:  
 ![Screenshot 2021-03-16 at 17.03.41](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/1/15759e52d45957c4dd509e21e394fc8d06493cba.png)

hope this works for you.

---

<div class="post-metadata">

**Author:** ![Ochedavid](https://avatars.discourse-cdn.com/v4/letter/o/dc4da7/32.png) [@Ochedavid](https://forum.codewithmosh.com/u/Ochedavid)\
**Post date:** [June 23, 2023, 12:57pm UTC](https://forum.codewithmosh.com/t/node-js-vidly-get-in-genres-test-js-does-not-pass-picture-attached/150/7 "2023-06-23T12:57:32Z")

</div>

I am the same issue… can anyone help please
