Facing these issues please help
(node:1571) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
FAIL tests/integration/genres.test.js
api/genres
GET/
✕ should return all the genres (1110 ms)
● api/genres › GET/ › should return all the genres
connect ECONNREFUSED 127.0.0.1:80
code:
const request = require(‘supertest’);
const {Genre} = require(‘…/…/route/models/genre’);
let server;
describe(‘api/genres’, () => {
beforeEach(() => { server = require(‘…/…/app’); });
afterEach(() => { server.close(); });
describe('GET/', () => {
it('should return all the genres', async () => {
await Genre.collection.insertMany([
{ name: 'genre1'},
{ name: 'genre12'}
]);
const res = await request(server).get('api/genres');
expect(res.status).toBe(200);
expect(res.body.length).toBe(2);
});
});
});