Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should remove dash from end of text', () => {
expect(slugify('abc-')).toEqual('abc');
});
});
it('should return string as lowercase', () => {
expect(slugify('ABC')).toEqual('abc');
});
it('should remove dash from start of text', () => {
expect(slugify('-abc')).toEqual('abc');
});
it('should replace multiple dashes with single dash', () => {
expect(slugify('a--bc')).toEqual('a-bc');
});
it('should replace spaces with dash', () => {
expect(slugify('a bc')).toEqual('a-bc');
});
it('should remove non-word characters', () => {
expect(slugify('a$bc')).toEqual('abc');
});