I'm submitting a...
[ ] Regression <!--(a behavior that used to work and stopped working in a new release)-->
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
Current behavior
I have weird coverage reports when I'm using Jest. So I took the 01-cats-app to check if it was not from my own project, but I see the same bugs.
Expected behavior
I see some else path not taken on import ... lines, some methods are not tested but are "covered" anyway...
I should have the proper coverage, based on what I'm testing.
Minimal reproduction of the problem with instructions
I took the 01-cats-app here https://github.com/nestjs/nest/tree/master/examples/01-cats-app
npm install
npm run test:coverage
Opening the html report of the controller from
./coverage/lcov-report/src/cats/cats.controller.ts.html

The only test is:
describe('findAll', () => {
it('should return an array of cats', async () => {
const result = ['test'];
jest.spyOn(catsService, 'findAll').mockImplementation(() => result);
expect(await catsController.findAll()).toBe(result);
});
});
Environment
- Nest version: 4.6.3
- Node version: 8.9.4
- Platform: Linux
I'm submitting a...
Current behavior
I have weird coverage reports when I'm using Jest. So I took the
01-cats-appto check if it was not from my own project, but I see the same bugs.Expected behavior
I see some
else path not takenonimport ...lines, some methods are not tested but are "covered" anyway...I should have the proper coverage, based on what I'm testing.
Minimal reproduction of the problem with instructions
I took the
01-cats-apphere https://github.com/nestjs/nest/tree/master/examples/01-cats-appOpening the html report of the controller from
The only test is:
Environment