1
- import { testBlock } from "bingo-stratum-testers" ;
2
- import { describe , expect , test } from "vitest" ;
1
+ import { testBlock , testIntake } from "bingo-stratum-testers" ;
2
+ import { describe , expect , it , test } from "vitest" ;
3
3
4
4
import { blockMarkdownlint } from "./blockMarkdownlint.js" ;
5
5
import { optionsBase } from "./options.fakes.js" ;
@@ -68,9 +68,7 @@ describe("blockMarkdownlint", () => {
68
68
],
69
69
"files": {
70
70
".markdownlint.json": "{"extends":"markdownlint/style/prettier","first-line-h1":false,"no-inline-html":false}",
71
- ".markdownlintignore": ".github/CODE_OF_CONDUCT.md
72
- CHANGELOG.md
73
- node_modules/
71
+ ".markdownlintignore": "node_modules/
74
72
",
75
73
},
76
74
"scripts": [
@@ -151,9 +149,7 @@ describe("blockMarkdownlint", () => {
151
149
],
152
150
"files": {
153
151
".markdownlint.json": "{"extends":"markdownlint/style/prettier","first-line-h1":false,"no-inline-html":false}",
154
- ".markdownlintignore": ".github/CODE_OF_CONDUCT.md
155
- CHANGELOG.md
156
- lib/
152
+ ".markdownlintignore": "lib/
157
153
node_modules/
158
154
",
159
155
},
@@ -244,9 +240,7 @@ describe("blockMarkdownlint", () => {
244
240
],
245
241
"files": {
246
242
".markdownlint.json": "{"extends":"markdownlint/style/prettier","first-line-h1":false,"no-inline-html":false}",
247
- ".markdownlintignore": ".github/CODE_OF_CONDUCT.md
248
- CHANGELOG.md
249
- node_modules/
243
+ ".markdownlintignore": "node_modules/
250
244
",
251
245
},
252
246
"scripts": [
@@ -260,4 +254,36 @@ describe("blockMarkdownlint", () => {
260
254
}
261
255
` ) ;
262
256
} ) ;
257
+
258
+ describe ( "intake" , ( ) => {
259
+ it ( "returns undefined when .markdownlintignore does not exist" , ( ) => {
260
+ const actual = testIntake ( blockMarkdownlint , {
261
+ files : { } ,
262
+ } ) ;
263
+
264
+ expect ( actual ) . toBeUndefined ( ) ;
265
+ } ) ;
266
+
267
+ it ( "returns no ignores when .markdownlintignore does not contain truthy lines" , ( ) => {
268
+ const actual = testIntake ( blockMarkdownlint , {
269
+ files : {
270
+ ".markdownlintignore" : [ "\n" ] ,
271
+ } ,
272
+ } ) ;
273
+
274
+ expect ( actual ) . toEqual ( { ignores : [ ] } ) ;
275
+ } ) ;
276
+
277
+ it ( "returns ignores when .markdownlintignore contains lines" , ( ) => {
278
+ const ignores = [ "abc" , "def" ] ;
279
+
280
+ const actual = testIntake ( blockMarkdownlint , {
281
+ files : {
282
+ ".markdownlintignore" : [ ignores . join ( "\n" ) + "\n" ] ,
283
+ } ,
284
+ } ) ;
285
+
286
+ expect ( actual ) . toEqual ( { ignores } ) ;
287
+ } ) ;
288
+ } ) ;
263
289
} ) ;
0 commit comments