express/test/index.test.js
2024-01-07 12:32:39 +01:00

12 lines
374 B
JavaScript

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);
});
});