fix: make dasherize trim first

This commit is contained in:
Oliver Eyton-Williams
2019-09-26 18:08:17 +02:00
committed by mrugesh
parent 3dc4e5897d
commit f159645810
2 changed files with 6 additions and 3 deletions

View File

@ -11,9 +11,11 @@ describe('dasherize', () => {
expect(dasherize('UPPERCASE')).toBe('uppercase');
});
it('converts spaces to dashes', () => {
expect(dasherize(' the space between ')).toBe(
'--the-space--between----'
);
expect(dasherize('the space between')).toBe('the-space--between');
});
it('trims off surrounding whitespace', () => {
expect(dasherize(' the space between ')).toBe('the-space--between');
});
it('removes everything except letters, numbers, - and .', () => {