> For the complete documentation index, see [llms.txt](https://deskpro.gitbook.io/deskpro-apps/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://deskpro.gitbook.io/deskpro-apps/tooling/tests.md).

# Tests

To ensure the quality of you app, it is important to add automated tests. A test framework in included in the App to help you set it up.

## Test examples

A dummy test is set up in `test/unit/App.test.js` to get you started:

```javascript
it('Passes', () => {
  expect(true).toBe(true);
});
```

### Snapshots

Jest allows to compare rendered React to saved snapshots to prevent breaking changes when modifying your app

```javascript
const result = renderer.create(<PageHome
  dpapp=      {dpapp}
  history=    {history}
  location=   {{ state }}
  />
).toJSON();

expect(result).toMatchSnapshot();
```

This will create a snapshot of your rendered html in `__snapshots__` that will prevent unexpected changes to applied. (You allows have the option to update a snapshot when running the tests when you do want to apply changes to the html).

## Running the tests

You can run your tests by running:

```bash
> yarn test
```
