@@ -1500,6 +1500,60 @@ describe('MarkdownProcessor', () => {
1500
1500
} ) ;
1501
1501
} ) ;
1502
1502
1503
+ it ( 'should replace issue links with urls if its a github repo.' , ( ) => {
1504
+ const manifest = {
1505
+ name : 'test' ,
1506
+ publisher : 'mocha' ,
1507
+ version : '0.0.1' ,
1508
+ description : 'test extension' ,
1509
+ engines : Object . create ( null ) ,
1510
+ repository : 'https://github.com/username/repository.git'
1511
+ } ;
1512
+
1513
+ const root = fixture ( 'readme' ) ;
1514
+ const processor = new ReadmeProcessor ( manifest , { } ) ;
1515
+ const readme = {
1516
+ path : 'extension/readme.md' ,
1517
+ localPath : path . join ( root , 'readme.github.md' )
1518
+ } ;
1519
+
1520
+ return processor . onFile ( readme )
1521
+ . then ( file => read ( file ) )
1522
+ . then ( actual => {
1523
+ return readFile ( path . join ( root , 'readme.github.expected.md' ) , 'utf8' )
1524
+ . then ( expected => {
1525
+ assert . equal ( actual , expected ) ;
1526
+ } ) ;
1527
+ } ) ;
1528
+ } ) ;
1529
+
1530
+ it ( 'should not replace issue links with urls if its not a github repo.' , ( ) => {
1531
+ const manifest = {
1532
+ name : 'test' ,
1533
+ publisher : 'mocha' ,
1534
+ version : '0.0.1' ,
1535
+ description : 'test extension' ,
1536
+ engines : Object . create ( null ) ,
1537
+ repository : 'https://some-other-provider.com/username/repository.git'
1538
+ } ;
1539
+
1540
+ const root = fixture ( 'readme' ) ;
1541
+ const processor = new ReadmeProcessor ( manifest , { } ) ;
1542
+ const readme = {
1543
+ path : 'extension/readme.md' ,
1544
+ localPath : path . join ( root , 'readme.github.md' )
1545
+ } ;
1546
+
1547
+ return processor . onFile ( readme )
1548
+ . then ( file => read ( file ) )
1549
+ . then ( actual => {
1550
+ return readFile ( path . join ( root , 'readme.github.md' ) , 'utf8' )
1551
+ . then ( expected => {
1552
+ assert . equal ( actual , expected ) ;
1553
+ } ) ;
1554
+ } ) ;
1555
+ } ) ;
1556
+
1503
1557
it ( 'should prevent non-HTTPS images' , async ( ) => {
1504
1558
const manifest = { name : 'test' , publisher : 'mocha' , version : '0.0.1' , engines : Object . create ( null ) , repository : 'https://github.com/username/repository' } ;
1505
1559
const contents = `` ;
0 commit comments