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