# jest-stylus

> Stylus serializer for jest snapshots.

Latest version **0.1.2** (published 2017-12-27) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install jest-stylus
pnpm add jest-stylus
yarn add jest-stylus
bun add jest-stylus
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2017-12-27 |
| First published | 2017-12-27 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Alan Souza |
| Maintainers | alansouzati |

## Links

- npm: https://www.npmjs.com/package/jest-stylus
- Repository: https://github.com/alansouzati/jest-stylus
- Homepage: https://github.com/alansouzati/jest-stylus#readme
- Issues: https://github.com/alansouzati/jest-stylus/issues
- npm.io page: https://npm.io/package/jest-stylus

## Dependencies (1)

- [css](https://npm.io/package/css.md) ^2.2.1

## Recent versions

- 0.1.2 (latest) — 2017-12-27
- 0.1.1 — 2017-12-27
- 0.1.0 — 2017-12-27

## README

[![Build Status](https://travis-ci.org/alansouzati/jest-stylus.svg?branch=master)](https://travis-ci.org/alansouzati/jest-stylus) [![Test Coverage](https://codeclimate.com/github/alansouzati/jest-stylus/badges/coverage.svg)](https://codeclimate.com/github/alansouzati/jest-stylus/coverage)

# jest-stylus

Stylus serializer for jest snapshots.

## Install

`npm install jest-stylus`

or 

`yarn add jest-stylus`

## Usage

```javascript
import React from 'react';
import Enzyme, { mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import path from 'path';

import jestStylus from 'jest-stylus';

import YourComponent from '../';

Enzyme.configure({ adapter: new Adapter() });
// must be the absolute path of your stylus file/files
jestStylus(path.resolve(__dirname, '../styles/index.styl'));
// jestStylus([path.resolve(__dirname, '../styles/colors.styl'), path.resolve(__dirname, '../styles/your-component.styl')]);

describe('YourComponent', () => {
  test('renders', () => {
    const component = mount(
      <YourComponent>test</YourComponent>
    );

    expect(component).toMatchSnapshot();
  });
});
```

When calling `jestStylus` your snapshots will have the CSS for the component you are testing, for example:

```
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`YourComponent renders 1`] = `
.your-component {
  background: blue;
}

<div
  class="your-component"
  data-reactroot=""
>
  test
</div>
`;

```

## Build 

To build this library, execute the following commands:

  1. Install NPM modules

    $ npm install (or yarn install)

  2. Test and run linters:

    $ npm test

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