Skip to content

Commit

Permalink
Added documentation for fixture method
Browse files Browse the repository at this point in the history
  • Loading branch information
nbeach committed Sep 28, 2018
1 parent fded6e4 commit 5a088a4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ it("sets the child components input", () => {
* [Mocked components and transclusion](#mocked-components-and-transclusion)
* [Custom mock providers](#custom-mock-providers)
* [Using real child components](#using-real-child-components)
* [Falling back to TestBed functionality](#falling-back-to-testbed-functionality)
* [Usage without test setup](#usage-without-test-setup)


Expand Down Expand Up @@ -372,6 +373,21 @@ testComponent(SubjectComponent)
.begin()
```

## Falling back to TestBed functionality

In the event that ng-unit does not allow you to test something in the desired way you can always fall back to TestBed
functionality by accessing the component fixture using `fixture()`.

```typescript
import {testComponent, fixture} from "ng-unit"

it("allows accessing the component fixture", () => {
testComponent(SubjectComponent).begin()

fixture().autoDetectChanges(true);
})
```

## Usage without test setup

Even if you don't wish to use ng-units test setup, you can still take advantage of it's mocking, component selection, and
Expand Down

0 comments on commit 5a088a4

Please sign in to comment.