@@ -7,22 +7,22 @@ tester.describe("json2md", test => {
7
7
test . it ( "should support headings" , function ( cb ) {
8
8
test . expect ( json2md ( {
9
9
h1 : "Heading 1"
10
- } ) ) . toBe ( "# Heading 1" ) ;
10
+ } ) ) . toBe ( "# Heading 1\n " ) ;
11
11
test . expect ( json2md ( {
12
12
h2 : "Heading 2"
13
- } ) ) . toBe ( "## Heading 2" ) ;
13
+ } ) ) . toBe ( "## Heading 2\n " ) ;
14
14
test . expect ( json2md ( {
15
15
h3 : "Heading 3"
16
- } ) ) . toBe ( "### Heading 3" ) ;
16
+ } ) ) . toBe ( "### Heading 3\n " ) ;
17
17
test . expect ( json2md ( {
18
18
h4 : "Heading 4"
19
- } ) ) . toBe ( "#### Heading 4" ) ;
19
+ } ) ) . toBe ( "#### Heading 4\n " ) ;
20
20
test . expect ( json2md ( {
21
21
h5 : "Heading 5"
22
- } ) ) . toBe ( "##### Heading 5" ) ;
22
+ } ) ) . toBe ( "##### Heading 5\n " ) ;
23
23
test . expect ( json2md ( {
24
24
h6 : "Heading 6"
25
- } ) ) . toBe ( "###### Heading 6" ) ;
25
+ } ) ) . toBe ( "###### Heading 6\n " ) ;
26
26
cb ( ) ;
27
27
} ) ;
28
28
@@ -51,7 +51,7 @@ tester.describe("json2md", test => {
51
51
ul : [
52
52
"item 1" , "item 2"
53
53
]
54
- } ) ) . toBe ( "\n - item 1\n - item 2" ) ;
54
+ } ) ) . toBe ( "\n - item 1\n - item 2\n " ) ;
55
55
cb ( ) ;
56
56
} ) ;
57
57
@@ -60,7 +60,7 @@ tester.describe("json2md", test => {
60
60
ul : [
61
61
"<em>item 1</em>" , "<bold>item 2</bold>"
62
62
]
63
- } ) ) . toBe ( "\n - *item 1*\n - **item 2**" ) ;
63
+ } ) ) . toBe ( "\n - *item 1*\n - **item 2**\n " ) ;
64
64
cb ( ) ;
65
65
} ) ;
66
66
@@ -70,7 +70,7 @@ tester.describe("json2md", test => {
70
70
ol : [
71
71
"item 1" , "item 2"
72
72
]
73
- } ) ) . toBe ( "\n 1. item 1\n 2. item 2" ) ;
73
+ } ) ) . toBe ( "\n 1. item 1\n 2. item 2\n " ) ;
74
74
cb ( ) ;
75
75
} ) ;
76
76
@@ -80,10 +80,13 @@ tester.describe("json2md", test => {
80
80
code : {
81
81
language : "js" ,
82
82
content : [
83
- "function sum (a, b) {" , " return a + b;" , "}" , "sum(1, 2);"
83
+ "function sum (a, b) {" ,
84
+ " return a + b;" ,
85
+ "}" ,
86
+ "sum(1, 2);"
84
87
]
85
88
}
86
- } ) ) . toBe ( "```js\nfunction sum (a, b) {\n return a + b;\n}\nsum(1, 2);\n```" ) ;
89
+ } ) ) . toBe ( "```js\nfunction sum (a, b) {\n return a + b;\n}\nsum(1, 2);\n```\n " ) ;
87
90
cb ( ) ;
88
91
} ) ;
89
92
@@ -113,7 +116,7 @@ tester.describe("json2md", test => {
113
116
} ;
114
117
test . expect ( json2md ( {
115
118
sayHello : "World"
116
- } ) ) . toBe ( "Hello World!" )
119
+ } ) ) . toBe ( "Hello World!\n " )
117
120
cb ( ) ;
118
121
} ) ;
119
122
@@ -126,7 +129,10 @@ tester.describe("json2md", test => {
126
129
code : {
127
130
language : "js" ,
128
131
content : [
129
- "function sum (a, b) {" , " return a + b;" , "}" , "sum(1, 2);"
132
+ "function sum (a, b) {" ,
133
+ " return a + b;" ,
134
+ "}" ,
135
+ "sum(1, 2);"
130
136
]
131
137
}
132
138
}
@@ -139,7 +145,8 @@ tester.describe("json2md", test => {
139
145
return a + b;
140
146
}
141
147
sum(1, 2);
142
- \`\`\`` ) ;
148
+ \`\`\`
149
+ \n` ) ;
143
150
cb ( ) ;
144
151
} ) ;
145
152
@@ -164,7 +171,8 @@ tester.describe("json2md", test => {
164
171
return a + b;
165
172
}
166
173
sum(1, 2);
167
- \`\`\`` ) ;
174
+ \`\`\`
175
+ \n` ) ;
168
176
cb ( ) ;
169
177
} ) ;
170
178
@@ -184,7 +192,7 @@ tester.describe("json2md", test => {
184
192
b : "col2"
185
193
} ]
186
194
}
187
- } ) ) . toBe ( "a | b\n--- | ---\ncol1 | col2" ) ;
195
+ } ) ) . toBe ( "a | b\n--- | ---\ncol1 | col2\n " ) ;
188
196
cb ( ) ;
189
197
} )
190
198
@@ -196,7 +204,7 @@ tester.describe("json2md", test => {
196
204
[ "col1" , "col2" ]
197
205
]
198
206
}
199
- } ) ) . toBe ( "a | b\n--- | ---\ncol1 | col2" ) ;
207
+ } ) ) . toBe ( "a | b\n--- | ---\ncol1 | col2\n " ) ;
200
208
cb ( ) ;
201
209
} )
202
210
} ) ;
0 commit comments