File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const someYaml = '---\nkey: value\nlist:\n - 1\n - 2\n---'
77const doc = 'Here is a document\nMore of the document\nOther lines\n'
88const both = someYaml + '\n' + doc
99
10- test ( 'matter' , async function ( ) {
10+ test ( 'matter' , async ( ) => {
1111 assert . deepEqual (
1212 Object . keys ( await import ( 'vfile-matter' ) ) . sort ( ) ,
1313 [ 'matter' ] ,
@@ -74,11 +74,18 @@ test('matter', async function () {
7474 { matter : { true : false } } ,
7575 'should pass yaml options (2)'
7676 )
77+ file = new VFile ( '---\n\n---\n' )
78+ matter ( file , { yaml : { version : '1.1' } } )
79+ assert . deepEqual (
80+ file . data ,
81+ { matter : null } ,
82+ 'should not crash on empty frontmatter'
83+ )
7784 file = new VFile ( '---\n---\n' )
7885 matter ( file , { yaml : { version : '1.1' } } )
7986 assert . deepEqual (
8087 file . data ,
81- { matter : { } } ,
88+ { matter : null } ,
8289 'should not crash on empty frontmatter'
8390 )
8491} )
You can’t perform that action at this time.
0 commit comments