| 55 | } |
| 56 | |
| 57 | @Controller('/test') |
| 58 | class TestController extends ApiController { |
| 59 | |
| 60 | @SendsResponse() |
| 61 | @HttpGet('/proceedCb') |
| 62 | proceedCb(): void { |
| 63 | setTimeout(() => { |
| 64 | this.dino.proceed({ data: 'Response_End' }); |
| 65 | }, 2); |
| 66 | } |
| 67 | |
| 68 | @SendsResponse() |
| 69 | @HttpGet('/errCb') |
| 70 | errCb(): void { |
| 71 | setTimeout(() => { |
| 72 | this.dino.throw(new Error('TestError')); |
| 73 | }, 2); |
| 74 | } |
| 75 | |
| 76 | @SendsResponse() |
| 77 | @HttpGet('/nextCb') |
| 78 | netWithCallback(): void { |
| 79 | setTimeout(() => { |
| 80 | return this.next(); |
| 81 | }, 2); |
| 82 | } |
| 83 | |
| 84 | // GET ?id=42 |
| 85 | @HttpGet('/query') |
| 86 | query(): any { |
| 87 | return { data: this.request.query.id }; |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | describe('api.controller.e2e.spec', () => { |
| 92 | const baseRoute = '/api/test'; |
nothing calls this directly
no test coverage detected