Skip to content

Commit

Permalink
add sequence test
Browse files Browse the repository at this point in the history
  • Loading branch information
flouc001 committed Jul 15, 2020
1 parent 014fbcf commit 75b2646
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/unit/marked-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ describe('Test slugger functionality', () => {
expect(slugger.slug('<h1>This Section</h1>')).toBe('this-section');
expect(slugger.slug('<h1>This Section</h1>', { dryrun: true })).toBe('this-section-1');
});

it('should be repeatable in a sequence', () => {
const slugger = new marked.Slugger();
expect(slugger.slug('foo')).toBe('foo');
expect(slugger.slug('foo')).toBe('foo-1');
expect(slugger.slug('foo')).toBe('foo-2');
expect(slugger.slug('foo', { dryrun: true })).toBe('foo-3');
expect(slugger.slug('foo', { dryrun: true })).toBe('foo-3');
expect(slugger.slug('foo')).toBe('foo-3');
expect(slugger.slug('foo')).toBe('foo-4');
});
});

describe('Test paragraph token type', () => {
Expand Down

0 comments on commit 75b2646

Please sign in to comment.