@@ -2,7 +2,7 @@ const { tmpdir } = require('os')
22const { rm, mkdtemp, mkdir } = require ( 'fs/promises' )
33const { resolve, join } = require ( 'path' )
44const test = require ( 'tape' )
5- const { contentRoot, makePermalink } = require ( '../helpers' )
5+ const { contentRoot, makePermalink, maybeRawHTMLType } = require ( '../helpers' )
66
77const tempDir = ( ) => {
88 return mkdtemp ( join ( tmpdir ( ) , 'writ-test-' ) )
@@ -123,4 +123,16 @@ test('helpers', t => {
123123 t . equal ( actual , expected , message )
124124 } )
125125 } )
126+
127+ t . test ( 'maybeRawHTMLType' , async ( ) => {
128+ t . equal ( maybeRawHTMLType ( '.html' ) , 'raw-html-type' , '.html' )
129+ t . equal ( maybeRawHTMLType ( '.HTML' ) , 'raw-html-type' , '.HTML' )
130+ t . equal ( maybeRawHTMLType ( '.hbs' ) , 'raw-html-type' , '.hbs' )
131+ t . equal ( maybeRawHTMLType ( '.handlebars' ) , 'raw-html-type' , '.handlebars' )
132+ t . equal ( maybeRawHTMLType ( '.HANDLEBARS' ) , 'raw-html-type' , '.HANDLEBARS' )
133+ t . equal ( maybeRawHTMLType ( '.HBS' ) , 'raw-html-type' , '.HBS' )
134+ t . equal ( maybeRawHTMLType ( '.xhtml' ) , null , '.xhtml does not count as raw html type' )
135+ t . equal ( maybeRawHTMLType ( '.htm' ) , null , '.htm does not count as raw html type' )
136+ t . equal ( maybeRawHTMLType ( '.xml' ) , null , '.xml does not count as raw html type' )
137+ } )
126138} )
0 commit comments