ngth is the spiritual successor/extension to ng-bullet. It offers the same functionality as well as resetting spy objects and mock services.
Using npm
npm install @apteco/ngth
Using yarn
*
yarn add @apteco/ngth
Most Angular spec files configure components like so:
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
/*list of components*/
],
imports: [
/* list of providers*/
]
}).compileComponents();
}));
With ngth we change this to:
import { configureSuite } from '@apteco/ngth';
...
configureSuite(() => {
TestBed.configureTestingModule({
declarations: [ /*list of components goes here*/ ],
imports: [ /* list of providers goes here*/ ]
})
});
There is no longer any need to call TestBed#compileComponents as ngth will call this and make sure that all components are compiled once and only once.