File tree Expand file tree Collapse file tree 2 files changed +29
-22
lines changed
Expand file tree Collapse file tree 2 files changed +29
-22
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ import * as assert from 'assert' ;
4+ import * as vscode from 'vscode' ;
5+ import * as path from 'path' ;
6+ import { parseMarkup , cssUri } from '../markupParser' ;
7+ import * as fs from 'fs' ;
8+
9+ // Defines a Mocha test suite to group tests of similar kind together
10+ suite ( "markupParser Tests" , function ( ) {
11+
12+ // Defines a Mocha unit test
13+ test ( "Test CSS Uri" , function ( ) {
14+ const expected = vscode . Uri . file ( path . join ( __dirname , "../../media/css/dummy.css" ) ) . with ( { "scheme" : 'vscode-resource' } ) ;
15+ const css = cssUri ( "dummy.css" ) ;
16+ assert . notEqual ( css , undefined ) ;
17+ if ( css ) {
18+ assert . equal ( css . fsPath , expected . fsPath ) ;
19+ assert . equal ( css . scheme , expected . scheme ) ;
20+ }
21+ } ) ;
22+
23+ test ( "Test render headers" , function ( ) {
24+ const testFile = vscode . Uri . file ( path . join ( __dirname , "../../src/test/testfiles/nix/scoped/headings.confluence" ) ) ;
25+ const expected = '<h1>Heading 1</h1><br /><h2>Heading 2</h2><br /><h3>Heading 3</h3><br /><h4>Heading 4</h4><br /><h5>Heading 5</h5><br /><h6>Heading 6</h6><br />'
26+ const content = fs . readFileSync ( testFile . fsPath , 'utf8' ) ;
27+ assert . equal ( parseMarkup ( testFile , content ) , expected ) ;
28+ } ) ;
29+ } ) ;
You can’t perform that action at this time.
0 commit comments