# prettygoat-testing

> Unit test prettygoat's projections without Cassandra.

Latest version **4.0.0** (published 2018-02-01) · 0 weekly downloads

## Install

```sh
npm install prettygoat-testing
pnpm add prettygoat-testing
yarn add prettygoat-testing
bun add prettygoat-testing
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2018-02-01 |
| First published | 2017-02-10 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+10 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | tierratelematics |

## Links

- npm: https://www.npmjs.com/package/prettygoat-testing
- npm.io page: https://npm.io/package/prettygoat-testing

## Dependencies (4)

- [rxjs](https://npm.io/package/rxjs.md) ~5.4.2
- [lodash](https://npm.io/package/lodash.md) ~4.13.1
- [inversify](https://npm.io/package/inversify.md) ^4.3.0
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) 0.1.8

## Recent versions

- 4.0.0 (latest) — 2018-02-01
- 3.1.0 — 2017-11-09
- 3.0.0 — 2017-10-05
- 2.0.0 — 2017-09-25
- 2.0.0-2 — 2017-08-29
- 2.0.0-1 — 2017-08-09
- 2.0.0-0 — 2017-07-27
- 1.1.0 — 2017-06-05
- 1.0.0 — 2017-06-05
- 0.4.1 — 2017-05-26
- 0.4.0 — 2017-05-25
- 0.3.3 — 2017-03-23
- 0.3.2 — 2017-03-22
- 0.3.1 — 2017-03-13
- 0.3.0 — 2017-02-27
- … 4 more at https://npm.io/package/prettygoat-testing/versions

## README

# Prettygoat-testing

Unit test prettygoat's projections without Cassandra.

## Installation

`
$ npm install prettygoat-testing
`

## Usage

```typescript
import {TestEnvironment, ITestRunner} from "prettygoat-testing";
import {Projection} from "./Projection";

describe("Given a projection", () => {

    let environment: TestEnvironment;
    let runner: ITestRunner<T>;

    before(() => {
        environment = new TestEnvironment();
        environment.setup();
    });

    beforeEach(() => {
        runner = environment.runner();
    });

    context("when something happens", () => {
        it("should do this", async () => {
            const events = require("./fixtures/events.json");
            let state = await runner
                .of(Projection) // Or pass an already newed projection
                .fromEvents(events)
                .stopAt(new Date(400))
                .run();
            //assert something
        });
    });
});
```

## License

Copyright 2016 Tierra SpA

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

---
_Source: https://npm.io/package/prettygoat-testing · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
