# Make test events

Use the mock command to print the events of a mock order system, for tests of streamview or of your own programs.

Source: https://www.eventcatalog.dev/tools/streamview/docs/how-to/make-test-events

The `mock` command prints events for a mock order system, one event on each line.
`streamview demo` uses the same events.

## Send test events to streamview

```
streamview mock --backfill 900 | streamview serve - --open
```

The page shows 15 minutes of old events, and then new events continuously.

## Write test events to a file

Add `--once`. The command then stops after it prints the old events.

```
streamview mock --backfill 3600 --once > events.jsonl
```

## Change the number of events

Add `--rate` with the number of orders for each second. The default is 5.
Each order makes more than one event.

```
streamview mock --rate 20 | streamview serve - --open
```

## Find the faults in the test events

The mock order system makes two faults in each interval of ten minutes:

- A bad release. Some `orders.placed` events send `total` as text.
- A payment outage. More payments fail, and `payments.captured` events come late.

## Related

- [Command line: `streamview mock`](https://www.eventcatalog.dev/tools/streamview/docs/reference/command-line#streamview-mock)
