Skip to content

Commit 8783590

Browse files
committed
enforce the right type for since and until
1 parent 368e702 commit 8783590

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

node-tests/index.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ describe('Json Tests', function () {
2424
`You don't need to define a displayId if it's the same as the file name`
2525
);
2626
}
27+
28+
// since is manditory and must be a string
29+
if (typeof contents.since !== 'string') {
30+
throw new Error('since frontmatter must be a string');
31+
}
32+
33+
// if you define an until then it must be a string
34+
if (contents.until && typeof contents.until !== 'string') {
35+
throw new Error('until frontmatter must be a string');
36+
}
2737
});
2838
});
2939
});

0 commit comments

Comments
 (0)