@@ -2,7 +2,7 @@ const { tmpdir } = require('os')
2
2
const { rm, mkdtemp, mkdir } = require ( 'fs/promises' )
3
3
const { resolve, join } = require ( 'path' )
4
4
const test = require ( 'tape' )
5
- const { contentRoot, makePermalink } = require ( '../helpers' )
5
+ const { contentRoot, makePermalink, maybeRawHTMLType } = require ( '../helpers' )
6
6
7
7
const tempDir = ( ) => {
8
8
return mkdtemp ( join ( tmpdir ( ) , 'writ-test-' ) )
@@ -123,4 +123,16 @@ test('helpers', t => {
123
123
t . equal ( actual , expected , message )
124
124
} )
125
125
} )
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
+ } )
126
138
} )
0 commit comments