Skip to content

Commit c49ae93

Browse files
Merge pull request #506 from /issues/505-convert-test
Convert markdown_parser_tests.js to use tap/tape
2 parents 0c21bd1 + f1284f5 commit c49ae93

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

test/markdown_parser_tests.js

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
"use strict";
22

3+
var tap = require('tap');
4+
35
var path = require('path');
46
var fs = require('fs-extra');
57
var mp = require('../core/lib/markdown_parser');
68
var markdown_parser = new mp();
79

8-
exports['markdown_parser'] = {
9-
'parses pattern description block correctly when frontmatter not present' : function(test) {
10+
11+
tap.test('parses pattern description block correctly when frontmatter not present', function(test) {
1012
//arrange
1113
var markdownFileName = path.resolve("./test/files/_patterns/00-test/00-foo.md");
1214
var markdownFileContents = fs.readFileSync(markdownFileName, 'utf8');
@@ -16,9 +18,10 @@ exports['markdown_parser'] = {
1618

1719
//assert
1820
test.equals(returnObject.markdown, '<h2>A Simple Include</h2>\n<p>This pattern contains an include of <code>test-bar</code>. It also has this markdown file, which does not have frontmatter.</p>\n');
19-
test.done();
20-
},
21-
'parses pattern description block correctly when frontmatter present' : function (test) {
21+
test.end();
22+
});
23+
24+
tap.test('parses pattern description block correctly when frontmatter present', function (test) {
2225
//arrange
2326
var markdownFileName = path.resolve("./test/files/_patterns/00-test/01-bar.md");
2427
var markdownFileContents = fs.readFileSync(markdownFileName, 'utf8');
@@ -29,19 +32,19 @@ exports['markdown_parser'] = {
2932
//assert
3033
test.equals(returnObject.markdown, '<h2>A Simple Bit of Markup</h2>\n<p>Foo cannot get simpler than bar, amiright?</p>\n');
3134
test.equals(returnObject.status, 'complete');
32-
test.done();
33-
},
34-
'parses frontmatter only when no markdown present': function (test) {
35-
//arrange
36-
var markdownFileName = path.resolve("./test/files/_patterns/00-test/03-styled-atom.md");
37-
var markdownFileContents = fs.readFileSync(markdownFileName, 'utf8');
38-
39-
//act
40-
var returnObject = markdown_parser.parse(markdownFileContents);
41-
42-
//assert
43-
test.equals(returnObject.markdown, '');
44-
test.equals(returnObject.status, 'inprogress');
45-
test.done();
46-
}
47-
};
35+
test.end();
36+
});
37+
38+
tap.test('parses frontmatter only when no markdown present', function (test) {
39+
//arrange
40+
var markdownFileName = path.resolve("./test/files/_patterns/00-test/03-styled-atom.md");
41+
var markdownFileContents = fs.readFileSync(markdownFileName, 'utf8');
42+
43+
//act
44+
var returnObject = markdown_parser.parse(markdownFileContents);
45+
46+
//assert
47+
test.equals(returnObject.markdown, '');
48+
test.equals(returnObject.status, 'inprogress');
49+
test.end();
50+
});

0 commit comments

Comments
 (0)