@@ -4,16 +4,11 @@ import { describe, expect, test } from "vitest";
4
4
import { blockREADME } from "./blockREADME.js" ;
5
5
import { optionsBase } from "./options.fakes.js" ;
6
6
7
- const options = {
8
- ...optionsBase ,
9
- usage : "Use it." ,
10
- } ;
11
-
12
7
describe ( "blockREADME" , ( ) => {
13
8
test ( "description with one sentence" , ( ) => {
14
9
const creation = testBlock ( blockREADME , {
15
10
options : {
16
- ...options ,
11
+ ...optionsBase ,
17
12
description : "One sentence." ,
18
13
} ,
19
14
} ) ;
@@ -31,7 +26,7 @@ describe("blockREADME", () => {
31
26
32
27
## Usage
33
28
34
- Use it .
29
+ Test usage .
35
30
36
31
## Development
37
32
@@ -47,7 +42,7 @@ describe("blockREADME", () => {
47
42
test ( "description with two sentences" , ( ) => {
48
43
const creation = testBlock ( blockREADME , {
49
44
options : {
50
- ...options ,
45
+ ...optionsBase ,
51
46
description : "First sentence. Second sentence." ,
52
47
} ,
53
48
} ) ;
@@ -68,13 +63,54 @@ describe("blockREADME", () => {
68
63
69
64
## Usage
70
65
66
+ Test usage.
67
+
68
+ ## Development
69
+
70
+ See [\`.github/CONTRIBUTING.md\`](./.github/CONTRIBUTING.md), then [\`.github/DEVELOPMENT.md\`](./.github/DEVELOPMENT.md).
71
+ Thanks! 💖
72
+
73
+ ",
74
+ },
75
+ }
76
+ ` ) ;
77
+ } ) ;
78
+
79
+ test ( "options.documentation" , ( ) => {
80
+ const creation = testBlock ( blockREADME , {
81
+ options : {
82
+ ...optionsBase ,
83
+ documentation : {
84
+ development : "Development docs." ,
85
+ readme : {
86
+ additional : "Additional docs." ,
87
+ usage : "Use it." ,
88
+ } ,
89
+ } ,
90
+ } ,
91
+ } ) ;
92
+
93
+ expect ( creation ) . toMatchInlineSnapshot ( `
94
+ {
95
+ "files": {
96
+ "README.md": "<h1 align="center">Test Title</h1>
97
+
98
+ <p align="center">Test description</p>
99
+
100
+ <p align="center">
101
+ <img alt="💪 TypeScript: Strict" src="https://img.shields.io/badge/%F0%9F%92%AA_typescript-strict-21bb42.svg" />
102
+ </p>
103
+
104
+ ## Usage
105
+
71
106
Use it.
72
107
73
108
## Development
74
109
75
110
See [\`.github/CONTRIBUTING.md\`](./.github/CONTRIBUTING.md), then [\`.github/DEVELOPMENT.md\`](./.github/DEVELOPMENT.md).
76
111
Thanks! 💖
77
112
113
+ Additional docs.
78
114
",
79
115
},
80
116
}
@@ -84,7 +120,7 @@ describe("blockREADME", () => {
84
120
test ( "options.explainer" , ( ) => {
85
121
const creation = testBlock ( blockREADME , {
86
122
options : {
87
- ...options ,
123
+ ...optionsBase ,
88
124
explainer : [ "And a one." , "And a two." ] ,
89
125
} ,
90
126
} ) ;
@@ -105,7 +141,7 @@ describe("blockREADME", () => {
105
141
106
142
## Usage
107
143
108
- Use it .
144
+ Test usage .
109
145
110
146
## Development
111
147
@@ -121,7 +157,7 @@ describe("blockREADME", () => {
121
157
test ( "options.logo without sizing" , ( ) => {
122
158
const creation = testBlock ( blockREADME , {
123
159
options : {
124
- ...options ,
160
+ ...optionsBase ,
125
161
logo : {
126
162
alt : "My logo" ,
127
163
src : "img.jpg" ,
@@ -144,7 +180,7 @@ describe("blockREADME", () => {
144
180
145
181
## Usage
146
182
147
- Use it .
183
+ Test usage .
148
184
149
185
## Development
150
186
@@ -160,7 +196,7 @@ describe("blockREADME", () => {
160
196
test ( "options.logo with sizing" , ( ) => {
161
197
const creation = testBlock ( blockREADME , {
162
198
options : {
163
- ...options ,
199
+ ...optionsBase ,
164
200
logo : {
165
201
alt : "My logo" ,
166
202
height : 100 ,
@@ -185,7 +221,7 @@ describe("blockREADME", () => {
185
221
186
222
## Usage
187
223
188
- Use it .
224
+ Test usage .
189
225
190
226
## Development
191
227
@@ -201,7 +237,7 @@ describe("blockREADME", () => {
201
237
test ( "options.explainer and options.logo" , ( ) => {
202
238
const creation = testBlock ( blockREADME , {
203
239
options : {
204
- ...options ,
240
+ ...optionsBase ,
205
241
explainer : [ "And a one." , "And a two." ] ,
206
242
logo : {
207
243
alt : "My logo" ,
@@ -230,7 +266,7 @@ describe("blockREADME", () => {
230
266
231
267
## Usage
232
268
233
- Use it .
269
+ Test usage .
234
270
235
271
## Development
236
272
@@ -244,9 +280,7 @@ describe("blockREADME", () => {
244
280
} ) ;
245
281
246
282
test ( "without addons" , ( ) => {
247
- const creation = testBlock ( blockREADME , {
248
- options,
249
- } ) ;
283
+ const creation = testBlock ( blockREADME , { options : optionsBase } ) ;
250
284
251
285
expect ( creation ) . toMatchInlineSnapshot ( `
252
286
{
@@ -261,7 +295,7 @@ describe("blockREADME", () => {
261
295
262
296
## Usage
263
297
264
- Use it .
298
+ Test usage .
265
299
266
300
## Development
267
301
@@ -295,7 +329,7 @@ describe("blockREADME", () => {
295
329
notices : [ "> Hello, world! 💖" ] ,
296
330
sections : [ `## Other\n\nHello!` ] ,
297
331
} ,
298
- options,
332
+ options : optionsBase ,
299
333
} ) ;
300
334
301
335
expect ( creation ) . toMatchInlineSnapshot ( `
@@ -314,7 +348,7 @@ describe("blockREADME", () => {
314
348
315
349
## Usage
316
350
317
- Use it .
351
+ Test usage .
318
352
319
353
## Development
320
354
0 commit comments