Skip to content

Commit edec4eb

Browse files
author
hermes-echo
committed
test: normalize bundled skill asset newlines
1 parent 0318a54 commit edec4eb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/package-smoke.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ for (const path of requiredAssets) {
3131
}
3232

3333
for (const path of requiredAssets.filter((asset) => asset.endsWith("/SKILL.md"))) {
34-
const contents = readFileSync(resolve(projectRoot, path), "utf8");
34+
const contents = normalizeNewlines(readFileSync(resolve(projectRoot, path), "utf8"));
3535
assert.match(
3636
contents,
3737
new RegExp(`\\n version: ${escapeRegExp(packageVersion)}\\n`),
@@ -53,3 +53,7 @@ for (const removedPath of [
5353
function escapeRegExp(value: string): string {
5454
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
5555
}
56+
57+
function normalizeNewlines(value: string): string {
58+
return value.replace(/\r\n/g, "\n");
59+
}

0 commit comments

Comments
 (0)