UNPKG

styled-components

Version:

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅

17 lines (13 loc) • 460 B
// @flow import escape from '../escape' describe('escape', () => { it('replaces characters that could be part of CSS selectors', () => { expect(escape('foo(bar):#*$><+~=|^baz')).toEqual('foo-bar-baz') }) it('replaces double hyphens with a single hyphen', () => { expect(escape('foo--bar')).toEqual('foo-bar') }) it('removes extraneous hyphens at the ends of the string', () => { expect(escape('-foo--bar-')).toEqual('foo-bar') }) })