open-index/open-npm huggingface dataset:
npm package: @outstem/metis
Description: Inspired by [ng-bullet](https://www.npmjs.com/package/ng-bullet), Metis is a library that aims to enhance unit testing in Angular by simplifying workflow and drastically improving Test Times.
Latest version: 1.0.0

# Metis

Inspired by [ng-bullet](https://www.npmjs.com/package/ng-bullet), Metis is a library that aims to enhance unit testing in Angular by simplifying workflow and drastically improving Test Times.

## Installation

```bash
npm install --save-dev @outstem/metis
# Or
yarn add -D @outstem/metis
```

## Usage

```ts
import {configureTestSuite} from '@outstem/metis';

// ...

configtureTestSuite(() =>
  TestBed.configureTestingModule({
    declarations: [
      /*list of components goes here*/
    ],
    imports: [
      /* list of providers goes here*/
    ],
  }),
);
```

### Helper Functions

**createTestContext**

Creates TestCtx instance for the Angular Component which is not initialized yet (no ngOnInit called)

Use case: you can override Component's providers before hooks are called.

```ts
let ctx: TestCtx<MyComponent>

beforeEach(() => {
  const ctx = createTestContext(MyComponent);
});

its(('will render') => {
  expect(ctx.component).toBeTruthy();
})

```

**createStableTestContext**

Creates TestCtx instance for the Angular Component and ask Angular to perform change detection
Angular lifecycle hooks (ngOninit) will be called when using this function to initialize the test
context.

```ts
let ctx: TestCtx<MyComponent>

beforeEach(async () => {
  const ctx = await createStableTestContext(MyComponent);
});

its(('will render') => {
  expect(ctx.component).toBeTruthy();
})

```