{"id":15041616,"url":"https://github.com/helpscout/seed-barista","last_synced_at":"2025-04-14T20:22:42.312Z","repository":{"id":65696015,"uuid":"85407885","full_name":"helpscout/seed-barista","owner":"helpscout","description":"☕️ Barista: CSS unit testing with Javascript","archived":false,"fork":false,"pushed_at":"2020-09-03T23:10:24.000Z","size":340,"stargazers_count":25,"open_issues_count":5,"forks_count":5,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-22T20:38:14.187Z","etag":null,"topics":["css","node-sass","open-source","sass","seed","unit-testing"],"latest_commit_sha":null,"homepage":"http://developer.helpscout.net/seed/css-unit-testing/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/helpscout.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-18T14:36:06.000Z","updated_at":"2024-03-01T18:18:15.000Z","dependencies_parsed_at":"2023-02-05T00:40:12.747Z","dependency_job_id":null,"html_url":"https://github.com/helpscout/seed-barista","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpscout%2Fseed-barista","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpscout%2Fseed-barista/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpscout%2Fseed-barista/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpscout%2Fseed-barista/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/helpscout","download_url":"https://codeload.github.com/helpscout/seed-barista/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248952819,"owners_count":21188506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","node-sass","open-source","sass","seed","unit-testing"],"created_at":"2024-09-24T20:46:17.333Z","updated_at":"2025-04-14T20:22:42.293Z","avatar_url":"https://github.com/helpscout.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"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)\n\n\u003cdiv\u003e\n\u003cimg src=\"https://github.com/helpscout/seed-barista/raw/master/barista.png\" width=\"200\" height=\"200\" title=\"Barista\"\u003e\n\u003c/div\u003e\n\nBarista is a Javascript utility for (S)CSS unit testing, compatible with most major test runners and assertion libraries.\n\nSeed isn't required for Barista to work. Although, Barista does make it easier to write tests for Seed CSS.\n\nFor added convenience, we recommend trying out [seed-bistro](https://github.com/helpscout/seed-bistro).\u003cbr\u003e\nIt comes with Barista + other libraries for CSS testing goodness 🙌\n\nThe latest versions of Barista require **Node.js v6** or newer to work (and not explode).\n\n## Install\n```\nnpm install seed-barista --save-dev\n```\n\n\n## Basic Usage\n\n### [Static](/docs/api/static.md)\n\nBelow 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.\n\n```javascript\nvar expect = require('chai').expect;\nvar barista = require('seed-barista');\n\ndescribe('harry component styles', function() {\n  it('should render a class of wizard + harry', function() {\n    var output = barista({ file: '_wizard.scss' });\n    var rule = output.rule('.your-a-wizard.harry');\n\n    expect(rule.exists()).to.be.true;\n    expect(rule.prop('background')).to.equal('red');\n    expect(rule.prop('color')).to.equal('yellow');\n  });\n});\n```\n\nCheck out the full [API documentation](/docs/api/static.md)\n\n\n\n### [Mounted](/docs/api/mounted.md)\n\nMounted 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.\n\n```javascript\nvar expect = require('chai').expect;\nvar barista = require('seed-barista');\n\ndescribe('harry component styles', function() {\n  it('should render a class of wizard + harry', function() {\n    var output = barista({ file: '_wizard.scss' }).mount();\n    var rule = output.find('.your-a-wizard.harry');\n\n    expect(rule.prop('background')).to.equal('red');\n    expect(rule.prop('color')).to.equal('yellow');\n  });\n});\n```\n\nCheck out the full [API documentation](/docs/api/mounted.md)\n\n\n\n## Examples\n\n**Check out an [example test](https://github.com/helpscout/seed-barista/blob/master/test/integration/examples/button.js)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelpscout%2Fseed-barista","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelpscout%2Fseed-barista","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelpscout%2Fseed-barista/lists"}