All Projects → helpscout → seed-barista

helpscout / seed-barista

Licence: other
☕️ Barista: CSS unit testing with Javascript

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to seed-barista

Clicker
Ionic 2 + @angular/cli Seed Project : Angular2 + Typescript + Karma + Protractor + Travis
Stars: ✭ 439 (+1729.17%)
Mutual labels:  unit-testing, seed
springboot-junit5-mockito2
Show case for how to use junit 5 and mockito 2 for unit testing and integration test in spring boot 2
Stars: ✭ 18 (-25%)
Mutual labels:  unit-testing
test-drive
The simple testing framework
Stars: ✭ 37 (+54.17%)
Mutual labels:  unit-testing
goreporter
A Golang tool that does static analysis, unit testing, code review and generate code quality report.
Stars: ✭ 3,019 (+12479.17%)
Mutual labels:  unit-testing
fe-standard-config-seed
前端通用代码规范自动化接入
Stars: ✭ 18 (-25%)
Mutual labels:  seed
Swatch
Watcher for Unit Tests written in Swift
Stars: ✭ 55 (+129.17%)
Mutual labels:  unit-testing
tink unittest
Tinkerbell Unit Testing
Stars: ✭ 15 (-37.5%)
Mutual labels:  unit-testing
refactoring-for-testability-cpp
Hard-to-test patterns in C++ and how to refactor them
Stars: ✭ 40 (+66.67%)
Mutual labels:  unit-testing
tead
Lighting the way to simpler testing
Stars: ✭ 55 (+129.17%)
Mutual labels:  unit-testing
FakeItEasy.AutoFakeIt
A very simple, yet flexible, "AutoFaker" for FakeItEasy to easily auto generate classes with faked dependencies.
Stars: ✭ 15 (-37.5%)
Mutual labels:  unit-testing
NiceDemo
iOS project, built on improved MVP architecture using Coordinator pattern for routing 😎
Stars: ✭ 54 (+125%)
Mutual labels:  unit-testing
Minecraft-Backdoor
Invisible, customizable backdoor for Minecraft Spigot Plugins.
Stars: ✭ 147 (+512.5%)
Mutual labels:  seed
KrazyKotlin
A collection of useful Kotlin Extension
Stars: ✭ 75 (+212.5%)
Mutual labels:  unit-testing
currency-api
A demo project on how to test a node/express app with Mocha, Nock and proxyquire (MNP) and code coverage with nyc/istanbul.
Stars: ✭ 19 (-20.83%)
Mutual labels:  unit-testing
emacs-jest
A package to run jest inside emacs
Stars: ✭ 74 (+208.33%)
Mutual labels:  unit-testing
ava-fast-check
Property based testing for AVA based on fast-check
Stars: ✭ 44 (+83.33%)
Mutual labels:  unit-testing
jest-preset-coffeescript
🃏 Easily write your Jests in @coffeescript.
Stars: ✭ 18 (-25%)
Mutual labels:  unit-testing
krab
Krab is a migration and automation tool for PostgreSQL based on HCL syntax
Stars: ✭ 15 (-37.5%)
Mutual labels:  unit-testing
vim-UT
Unit Testing plugin for Vim
Stars: ✭ 18 (-25%)
Mutual labels:  unit-testing
stubthat
Stubbing framework for R
Stars: ✭ 17 (-29.17%)
Mutual labels:  unit-testing

Barista ☕️ Build Status Coverage Status npm version dependencies Status Gitter

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.
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

Below is an example of how you can setup a Mocha test with Barista. A fast and simple way to test .scss output is to verify the rendered output matches against expected strings.

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

Mounted

Mounted based testing creates a virtual DOM, allowing you to write assertions against DOM elements. Barista's Mounted API uses jQuery to retrieve computed CSS styles.

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

Examples

Check out an example test

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].