@@ -4,16 +4,11 @@ import { describe, expect, test } from "vitest";
44import { blockREADME } from "./blockREADME.js" ;
55import { optionsBase } from "./options.fakes.js" ;
66
7- const options = {
8- ...optionsBase ,
9- usage : "Use it." ,
10- } ;
11-
127describe ( "blockREADME" , ( ) => {
138 test ( "description with one sentence" , ( ) => {
149 const creation = testBlock ( blockREADME , {
1510 options : {
16- ...options ,
11+ ...optionsBase ,
1712 description : "One sentence." ,
1813 } ,
1914 } ) ;
@@ -31,7 +26,7 @@ describe("blockREADME", () => {
3126
3227 ## Usage
3328
34- Use it .
29+ Test usage .
3530
3631 ## Development
3732
@@ -47,7 +42,7 @@ describe("blockREADME", () => {
4742 test ( "description with two sentences" , ( ) => {
4843 const creation = testBlock ( blockREADME , {
4944 options : {
50- ...options ,
45+ ...optionsBase ,
5146 description : "First sentence. Second sentence." ,
5247 } ,
5348 } ) ;
@@ -68,13 +63,54 @@ describe("blockREADME", () => {
6863
6964 ## Usage
7065
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+
71106 Use it.
72107
73108 ## Development
74109
75110 See [\`.github/CONTRIBUTING.md\`](./.github/CONTRIBUTING.md), then [\`.github/DEVELOPMENT.md\`](./.github/DEVELOPMENT.md).
76111 Thanks! 💖
77112
113+ Additional docs.
78114 ",
79115 },
80116 }
@@ -84,7 +120,7 @@ describe("blockREADME", () => {
84120 test ( "options.explainer" , ( ) => {
85121 const creation = testBlock ( blockREADME , {
86122 options : {
87- ...options ,
123+ ...optionsBase ,
88124 explainer : [ "And a one." , "And a two." ] ,
89125 } ,
90126 } ) ;
@@ -105,7 +141,7 @@ describe("blockREADME", () => {
105141
106142 ## Usage
107143
108- Use it .
144+ Test usage .
109145
110146 ## Development
111147
@@ -121,7 +157,7 @@ describe("blockREADME", () => {
121157 test ( "options.logo without sizing" , ( ) => {
122158 const creation = testBlock ( blockREADME , {
123159 options : {
124- ...options ,
160+ ...optionsBase ,
125161 logo : {
126162 alt : "My logo" ,
127163 src : "img.jpg" ,
@@ -144,7 +180,7 @@ describe("blockREADME", () => {
144180
145181 ## Usage
146182
147- Use it .
183+ Test usage .
148184
149185 ## Development
150186
@@ -160,7 +196,7 @@ describe("blockREADME", () => {
160196 test ( "options.logo with sizing" , ( ) => {
161197 const creation = testBlock ( blockREADME , {
162198 options : {
163- ...options ,
199+ ...optionsBase ,
164200 logo : {
165201 alt : "My logo" ,
166202 height : 100 ,
@@ -185,7 +221,7 @@ describe("blockREADME", () => {
185221
186222 ## Usage
187223
188- Use it .
224+ Test usage .
189225
190226 ## Development
191227
@@ -201,7 +237,7 @@ describe("blockREADME", () => {
201237 test ( "options.explainer and options.logo" , ( ) => {
202238 const creation = testBlock ( blockREADME , {
203239 options : {
204- ...options ,
240+ ...optionsBase ,
205241 explainer : [ "And a one." , "And a two." ] ,
206242 logo : {
207243 alt : "My logo" ,
@@ -230,7 +266,7 @@ describe("blockREADME", () => {
230266
231267 ## Usage
232268
233- Use it .
269+ Test usage .
234270
235271 ## Development
236272
@@ -244,9 +280,7 @@ describe("blockREADME", () => {
244280 } ) ;
245281
246282 test ( "without addons" , ( ) => {
247- const creation = testBlock ( blockREADME , {
248- options,
249- } ) ;
283+ const creation = testBlock ( blockREADME , { options : optionsBase } ) ;
250284
251285 expect ( creation ) . toMatchInlineSnapshot ( `
252286 {
@@ -261,7 +295,7 @@ describe("blockREADME", () => {
261295
262296 ## Usage
263297
264- Use it .
298+ Test usage .
265299
266300 ## Development
267301
@@ -295,7 +329,7 @@ describe("blockREADME", () => {
295329 notices : [ "> Hello, world! 💖" ] ,
296330 sections : [ `## Other\n\nHello!` ] ,
297331 } ,
298- options,
332+ options : optionsBase ,
299333 } ) ;
300334
301335 expect ( creation ) . toMatchInlineSnapshot ( `
@@ -314,7 +348,7 @@ describe("blockREADME", () => {
314348
315349 ## Usage
316350
317- Use it .
351+ Test usage .
318352
319353 ## Development
320354
0 commit comments