16 lines
509 B
TypeScript
16 lines
509 B
TypeScript
import request from 'supertest';
|
|
import server from '../../src/server';
|
|
|
|
it('should respond to /secondroute', async () => {
|
|
const res = await request(server).get('/secondroute');
|
|
expect(res.statusCode).toEqual(200);
|
|
});
|
|
|
|
it('should respond to /secondroute/somepath/:para/', async () => {
|
|
const res = await request(server).get('/secondroute/somepath/myparam');
|
|
expect(res.statusCode).toEqual(200);
|
|
expect(res.text).toEqual(
|
|
'Hello from Second Router somePath route with param: myparam',
|
|
);
|
|
});
|