@@ -18,7 +18,7 @@ import { fileURLToPath } from 'node:url'
18
18
import net from 'node:net'
19
19
import getPort from 'get-port'
20
20
import '../build/globals.js'
21
- import { isMain , normalizeExt } from '../build/cli.js'
21
+ import { isMain , normalizeExt , transformMarkdown } from '../build/cli.js'
22
22
23
23
const __filename = fileURLToPath ( import . meta. url )
24
24
const spawn = $ . spawn
@@ -283,12 +283,31 @@ describe('cli', () => {
283
283
assert . ok ( [ 'EACCES' , 'ENOENT' ] . includes ( e . code ) )
284
284
}
285
285
} )
286
- } )
287
286
288
- test ( 'normalizeExt()' , ( ) => {
289
- assert . equal ( normalizeExt ( '.ts' ) , '.ts' )
290
- assert . equal ( normalizeExt ( 'ts' ) , '.ts' )
291
- assert . equal ( normalizeExt ( '.' ) , '.' )
292
- assert . equal ( normalizeExt ( ) , undefined )
287
+ test ( 'transformMarkdown()' , ( ) => {
288
+ // prettier-ignore
289
+ assert . equal ( transformMarkdown ( `
290
+ # Title
291
+
292
+ ~~~js
293
+ await $\`echo "tilde"\`
294
+ ~~~
295
+
296
+ ` ) , `//
297
+ // # Title
298
+ //
299
+
300
+ await $\`echo "tilde"\`
301
+
302
+ //
303
+ // ` )
304
+ } )
305
+
306
+ test ( 'normalizeExt()' , ( ) => {
307
+ assert . equal ( normalizeExt ( '.ts' ) , '.ts' )
308
+ assert . equal ( normalizeExt ( 'ts' ) , '.ts' )
309
+ assert . equal ( normalizeExt ( '.' ) , '.' )
310
+ assert . equal ( normalizeExt ( ) , undefined )
311
+ } )
293
312
} )
294
313
} )
0 commit comments