Skip to content

Commit

Permalink
Fix unit tests for slugger
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Dec 21, 2018
1 parent 5c926e2 commit 632ac5d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/unit/marked-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ describe('Test slugger functionality', function() {
expect(slugger.slug('test')).toBe('test-2');
});

it('should be unique to avoid collisions 1401', function() {
it('should be unique when slug ends with number', function() {
var slugger = new marked.Slugger();
expect(slugger.slug('test 1')).toBe('test-1');
expect(slugger.slug('test')).toBe('test');
expect(slugger.slug('test')).toBe('test-2');
});

it('should be unique when slug ends with hyphen number', function() {
var slugger = new marked.Slugger();
expect(slugger.slug('foo')).toBe('foo');
expect(slugger.slug('foo')).toBe('foo-1');
Expand Down

0 comments on commit 632ac5d

Please sign in to comment.