express/test/index.test.js

12 lines
374 B
JavaScript
Raw Permalink Normal View History

2024-01-07 12:32:39 +01:00
const request = require('supertest');
const app = require('../src/app');
describe('Test router', () => {
test('It should response 404 when tries to get not found route', async () => {
const response = await request(app)
.post('/api')
.set('X-Requested-With', 'XMLHttpRequest');
expect(response.statusCode).toBe(404);
});
});