Skip to content

Commit 1ebef90

Browse files
committed
test: add test to check that gray-matter's js engine is disabled by default
1 parent 4bc3641 commit 1ebef90

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/lib/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const defaultConfig: Config = {
2929
engines: {
3030
js: () =>
3131
new Error(
32-
'The JS engine for front-matter is disabled by default for security reasons. You can enable it by configuring graymatter_options.',
32+
'The JS engine for front-matter is disabled by default for security reasons. You can enable it by configuring gray_matter_options.',
3333
),
3434
},
3535
},

src/test/lib.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ import { isHttpUrl } from '../lib/is-http-url';
1111
import { isMdFile } from '../lib/is-md-file';
1212
import { readFile } from '../lib/read-file';
1313

14+
// --
15+
// config
16+
test("gray-matter's js engine is disabled by default", (t) => {
17+
t.throws(() => {
18+
throw (defaultConfig.gray_matter_options.engines!.js as () => Error)();
19+
});
20+
});
21+
1422
// --
1523
// helpers
1624

0 commit comments

Comments
 (0)