# @jsxui/layout-snapshot

> Jest snapshot matcher to generate screenshots of your layout tests.

Latest version **0.0.3** (published 2022-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jsxui/layout-snapshot
pnpm add @jsxui/layout-snapshot
yarn add @jsxui/layout-snapshot
bun add @jsxui/layout-snapshot
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2022-08-27 |
| First published | 2022-07-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Travis Arnold |
| Maintainers | souporserious |

## Links

- npm: https://www.npmjs.com/package/@jsxui/layout-snapshot
- Repository: https://github.com/souporserious/jsxui/tree/main/@jsxui/layout-snapshot
- npm.io page: https://npm.io/package/@jsxui/layout-snapshot

## Dependencies (5)

- [canvas](https://npm.io/package/canvas.md) ^2.9.3
- [d3-color](https://npm.io/package/d3-color.md) ^3.1.0
- [d3-interpolate](https://npm.io/package/d3-interpolate.md) ^3.0.1
- [canvas-sketch-util](https://npm.io/package/canvas-sketch-util.md) ^1.10.0
- [jest-image-snapshot](https://npm.io/package/jest-image-snapshot.md) ^5.1.1

## Recent versions

- 0.0.3 (latest) — 2022-08-27
- 0.0.1 — 2022-07-14

## README

# @jsxui/layout-snapshot

[Jest snapshot matcher](https://jestjs.io/docs/snapshot-testing) to generate screenshots of your layout tests.

## Install

```bash
yarn add @jsxui/layout-snapshot
npm install @jsxui/layout-snapshot
```

## Usage

```ts
import { computeLayout, createColumn, createNode } from '@jsxui/layout'
import { toMatchLayoutSnapshot } from '@jsxui/layout-snapshot'

expect.extend({ toMatchLayoutSnapshot })

test('positions Column children along vertical axis', () => {
  const node1 = createNode({ width: 2, height: 2 })
  const node2 = createNode({ width: 4, height: 1 })
  const column = createColumn({
    columns: 1,
    rows: 4,
    children: [node1, node2],
  })
  const { layout } = computeLayout(column)

  expect(layout).toMatchLayoutSnapshot()
})
```

## Development

If you are experiencing issues installing the package for development on your machine, it's most likely due to the `canvas` dependency this package relies on. Check the installation instructions [here](https://github.com/Automattic/node-canvas/wiki/Installation%3A-Mac-OS-X) to make sure you have the appropriate libaries installed.

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