Skip to content

Commit

Permalink
Add unit test for skip function (thlorenz#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfcon authored Jun 17, 2021
1 parent 5258371 commit dcbdb1c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/fixtures/readme-with-skipTag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Hello, world!

README to test doctoc with skipTag.

<!-- DOCTOC SKIP -->

## Installation
## API
## License
17 changes: 17 additions & 0 deletions test/transform-skipTag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict';
/*jshint asi: true */

var test = require('tap').test
, transform = require('../lib/transform');

test('\nskip file transform', function (t) {
var content = require('fs').readFileSync(__dirname + '/fixtures/readme-with-skipTag.md', 'utf8');
var transformedContent = transform(content);

t.deepEqual(
transformedContent.toc
, undefined
, 'skip correct file'
)
t.end()
});

0 comments on commit dcbdb1c

Please sign in to comment.