File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,24 @@ It is good.
269
269
expect ( title ) . toBe ( "My Awesome Package" ) ;
270
270
} ) ;
271
271
272
+ it ( "converts 'typescript' to 'TypeScript' when parsed from the repository name" , async ( ) => {
273
+ const title = await readDefaultsFromReadme (
274
+ ( ) => Promise . resolve ( "" ) ,
275
+ ( ) => Promise . resolve ( "my-typescript-app" ) ,
276
+ ) . title ( ) ;
277
+
278
+ expect ( title ) . toBe ( "My TypeScript App" ) ;
279
+ } ) ;
280
+
281
+ it ( "converts 'eslint' to 'ESLint' when parsed from the repository name" , async ( ) => {
282
+ const title = await readDefaultsFromReadme (
283
+ ( ) => Promise . resolve ( "" ) ,
284
+ ( ) => Promise . resolve ( "my-eslint-plugin" ) ,
285
+ ) . title ( ) ;
286
+
287
+ expect ( title ) . toBe ( "My ESLint Plugin" ) ;
288
+ } ) ;
289
+
272
290
it ( "returns undefined when title does not exist" , async ( ) => {
273
291
const title = await readDefaultsFromReadme (
274
292
( ) => Promise . resolve ( `Other text.` ) ,
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ export function readDefaultsFromReadme(
68
68
return (
69
69
repositoryValue &&
70
70
titleCase ( repositoryValue )
71
+ . replaceAll ( "Eslint" , "ESLint" )
71
72
. replaceAll ( "Typescript" , "TypeScript" )
72
73
. replaceAll ( "-" , " " )
73
74
) ;
You can’t perform that action at this time.
0 commit comments