File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -154,26 +154,6 @@ await describe("isValidChangenoteFile", async () => {
154154 assert . equal ( isValidChangenoteFile ( "non-existent-file.md" ) , false ) ;
155155 } ) ;
156156
157- await it ( "rejects invalid filename" , async ( ) => {
158- await withTmpFile (
159- "fix-bug.md" ,
160- "---\ncategory: fix\n---\n- Fixed a bug\n" ,
161- ( filePath ) => {
162- assert . equal ( isValidChangenoteFile ( filePath ) , false ) ;
163- } ,
164- ) ;
165- } ) ;
166-
167- await it ( "rejects missing frontmatter" , async ( ) => {
168- await withTmpFile (
169- "2026-01-01-fix-bug.md" ,
170- "- Fixed a bug\n" ,
171- ( filePath ) => {
172- assert . equal ( isValidChangenoteFile ( filePath ) , false ) ;
173- } ,
174- ) ;
175- } ) ;
176-
177157 await it ( "rejects invalid Markdown" , async ( ) => {
178158 await withTmpFile (
179159 "2026-01-01-fix-bug.md" ,
Original file line number Diff line number Diff line change 11import * as fs from "node:fs" ;
2- import * as path from "node:path" ;
32
43import { matter } from "lite-matter" ;
54import type { List , ListItem } from "mdast" ;
@@ -95,21 +94,7 @@ export function isValidChangenoteFile(filename: string): boolean {
9594 return false ;
9695 }
9796
98- const { data : frontmatter , content } = matter ( fileData ) ;
99-
100- if ( ! isValidChangenoteFilename ( path . basename ( filename ) ) ) {
101- isValid = false ;
102- console . error (
103- `${ filename } : invalid filename; must match pattern YYYY-MM-DD-id.md` ,
104- ) ;
105- }
106- if ( ! hasValidChangenoteCategory ( frontmatter ) ) {
107- isValid = false ;
108- const categories = Object . keys ( VALID_CHANGE_NOTE_CATEGORIES ) . join ( ", " ) ;
109- console . error (
110- `${ filename } : invalid category; must be one of: ${ categories } ` ,
111- ) ;
112- }
97+ const { content } = matter ( fileData ) ;
11398 if ( ! isValidChangenoteContent ( content ) ) {
11499 isValid = false ;
115100 console . error (
You can’t perform that action at this time.
0 commit comments