Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 1.12 KB

README.md

File metadata and controls

51 lines (38 loc) · 1.12 KB

What is ngth

ngth is the spiritual successor/extension to ng-bullet. It offers the same functionality as well as resetting spy objects and mock services.

Getting Started

Installation

Using npm

npm install @apteco/ngth

Using yarn*

yarn add @apteco/ngth

Spec Files

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.