# seed-barista

> Test helper for Seed CSS

Latest version **1.1.1** (published 2018-10-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install seed-barista
pnpm add seed-barista
yarn add seed-barista
bun add seed-barista
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2018-10-15 |
| First published | 2017-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 56.4 KB |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 25 |
| Maintainers | itsjonq |
| Keywords | barista, bem, css, design, functional, helper, itcss, modular, mocha, oocss, performance, seed, scss, test, testing |

## Links

- npm: https://www.npmjs.com/package/seed-barista
- Repository: https://github.com/helpscout/seed-barista
- Homepage: https://github.com/helpscout/seed-barista#readme
- Issues: https://github.com/helpscout/seed-barista/issues
- npm.io page: https://npm.io/package/seed-barista

## Dependencies (10)

- [jsdom](https://npm.io/package/jsdom.md) ^11.11.0
- [jquery](https://npm.io/package/jquery.md) ^3.2.1
- [postcss](https://npm.io/package/postcss.md) ^7.0.5
- [find-root](https://npm.io/package/find-root.md) ^1.1.0
- [node-sass](https://npm.io/package/node-sass.md) ^4.9.4
- [lodash.has](https://npm.io/package/lodash.has.md) ^4.5.2
- [css-mq-parser](https://npm.io/package/css-mq-parser.md) ^0.0.3
- [lodash.flatten](https://npm.io/package/lodash.flatten.md) ^4.4.0
- [seed-harvester](https://npm.io/package/seed-harvester.md) ^0.1.5
- [sass-pathfinder](https://npm.io/package/sass-pathfinder.md) ^0.0.5

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2018-10-15
- 1.1.0 — 2018-07-04
- 1.0.4 — 2017-07-28
- 1.0.3 — 2017-06-19
- 1.0.2 — 2017-05-30
- 1.0.1 — 2017-05-29
- 1.0.0 — 2017-05-28
- 0.8.2 — 2017-05-27
- 0.8.1 — 2017-05-27
- 0.8.0 — 2017-05-27
- 0.7.0 — 2017-05-26
- 0.6.2 — 2017-05-25
- 0.6.1 — 2017-05-25
- 0.6.0 — 2017-05-25
- 0.5.0 — 2017-05-20
- … 15 more at https://npm.io/package/seed-barista/versions

## README

# Barista ☕️ [![Build Status](https://travis-ci.org/helpscout/seed-barista.svg?branch=master)](https://travis-ci.org/helpscout/seed-barista) [![Coverage Status](https://coveralls.io/repos/github/helpscout/seed-barista/badge.svg?branch=master)](https://coveralls.io/github/helpscout/seed-barista?branch=master) [![npm version](https://badge.fury.io/js/seed-barista.svg)](https://badge.fury.io/js/seed-barista) [![dependencies Status](https://david-dm.org/helpscout/seed-barista/status.svg)](https://david-dm.org/helpscout/seed-barista) [![Gitter](https://badges.gitter.im/join_chat.svg)](https://gitter.im/seed-css/barista)

<div>
<img src="https://github.com/helpscout/seed-barista/raw/master/barista.png" width="200" height="200" title="Barista">
</div>

Barista is a Javascript utility for (S)CSS unit testing, compatible with most major test runners and assertion libraries.

Seed isn't required for Barista to work. Although, Barista does make it easier to write tests for Seed CSS.

For added convenience, we recommend trying out [seed-bistro](https://github.com/helpscout/seed-bistro).<br>
It comes with Barista + other libraries for CSS testing goodness 🙌

The latest versions of Barista require **Node.js v6** or newer to work (and not explode).

## Install
```
npm install seed-barista --save-dev
```


## Basic Usage

### [Static](/docs/api/static.md)

Below is an example of how you can setup a [Mocha](https://mochajs.org/) test with Barista. A fast and simple way to test `.scss` output is to verify the rendered output matches against expected strings.

```javascript
var expect = require('chai').expect;
var barista = require('seed-barista');

describe('harry component styles', function() {
  it('should render a class of wizard + harry', function() {
    var output = barista({ file: '_wizard.scss' });
    var rule = output.rule('.your-a-wizard.harry');

    expect(rule.exists()).to.be.true;
    expect(rule.prop('background')).to.equal('red');
    expect(rule.prop('color')).to.equal('yellow');
  });
});
```

Check out the full [API documentation](/docs/api/static.md)



### [Mounted](/docs/api/mounted.md)

Mounted based testing creates a [virtual DOM](https://github.com/tmpvar/jsdom), allowing you to write assertions against DOM elements. Barista's Mounted API uses jQuery to retrieve computed CSS styles.

```javascript
var expect = require('chai').expect;
var barista = require('seed-barista');

describe('harry component styles', function() {
  it('should render a class of wizard + harry', function() {
    var output = barista({ file: '_wizard.scss' }).mount();
    var rule = output.find('.your-a-wizard.harry');

    expect(rule.prop('background')).to.equal('red');
    expect(rule.prop('color')).to.equal('yellow');
  });
});
```

Check out the full [API documentation](/docs/api/mounted.md)



## Examples

**Check out an [example test](https://github.com/helpscout/seed-barista/blob/master/test/integration/examples/button.js)**

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