Performance Improvements (similiar ng-bullet)
A large Unit Test (23 Tests) is running for ~10minutes.
There is a library (ng-bullet), which avoids recompiling everything
used to configure the TestBed for every test in a suite, thus increasing the overall test execution time alot (~30 seconds).
https://github.com/topnotch48/ng-bullet-workspace/blob/master/projects/ng-bullet/README.md
Downside on this library is, that it is no longer maintained.
Are there any plans, integrating the approach of ng-bullet
in jest in the near future and thus increasing the performance of jest?
Execution time of Jest unit tests will be similiar to execution time when using ng-bullet
System:
OS: Windows 10 10.0.17763
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Binaries:
Node: 10.15.0 - C:\Program Files\nodejs\node.EXE
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
definitely, I think it looks very promising.
In the root README of the linked repository the owner recommends another project, maybe we should consider both.
Referenced project.
Not mantained
https://github.com/topnotch48/ng-bullet-workspace#update
Look at spectator, it seems to be out of the scope of the preset. Not sure how to integrate into here.
Not mantained
https://github.com/topnotch48/ng-bullet-workspace#update
@splincode
That was the whole point of this feature request. ng-bullet is not maintained, so it would be great if "jest-preset-angular" would integrate the performance boost of ng-bullet.
@r-kernberger I see.
We currently have other features in focus, but we are always open to PRs.
I think key for success of this integration is that the interface of the tests does not change (much), so that developers have a low threshold to adopt the performance boost.
E. g. this could be an integration I would love:
import {
async,
ComponentFixture,
- TestBed
} from '@angular/core/testing';
+ import { TestBed } from 'jest-preset-angular/speedup-testbed';
describe('suite', () => {
let comp, userService;
beforeEach(() => {
TestBed.configureTestingModule({
providers: [ WelcomeComponent, { provide: UserService, useClass: MockUserService } ]
});
comp = TestBed.inject(WelcomeComponent);
userService = TestBed.inject(UserService);
});
it('should not have welcome message after construction', () => {
expect(comp.welcome).toBeUndefined();
});
});
I gave a try with @ngneat/spectator, it is quite good in term of testing util convenience, not sure if it boosts or not.