@@ -16,42 +16,41 @@ const mockCommits: Release.MockCommit[] = [
1616 { message : 'feat: blah' , version : '0.1.0' } ,
1717]
1818
19- describe ( '.render()' , ( ) => {
20- describe ( 'markdown renderer option' , ( ) => {
21- const render = ( ...commits : Release . MockCommit [ ] ) => {
22- return Changelog . Renderers . Markdown . render ( Changelog . fromSeries ( Release . fromMockCommits ( commits ) ) )
23- }
24- it ( 'renders release changelog for the current release series' , ( ) => {
25- const changelog = render ( ...mockCommits )
26- expect ( changelog ) . toMatchSnapshot ( )
27- } )
28- it ( 'shows breaking commits twice, once in breaking section and once in its native section' , ( ) => {
29- const changelog = render ( { message : 'a: foo\n\nBREAKING CHANGE:\nbar' } )
30- expect ( changelog ) . toMatch ( / B R E A K I N G C H A N G E S \n \n .* f o o / )
31- expect ( changelog ) . toMatch ( / I m p r o v e m e n t s \n \n .* f o o / )
32- } )
33- it ( 'shows breaking label if commit breaking except within breaking section' , ( ) => {
34- const changelog = render ( { message : 'a: foo\n\nBREAKING CHANGE:\nbar' } )
35- expect ( changelog ) . toMatch ( / I m p r o v e m e n t s \n \n .* ( b r e a k i n g ) .* f o o / )
36- } )
37- it ( 'hides unknown section if no unknown commits' , ( ) => {
38- const changelog = render ( { message : 'a: b' } )
39- expect ( changelog ) . not . toMatch ( Changelog . empty ( ) . unspecified . label )
40- } )
41- it ( 'improvements section prefixes commits with their type' , ( ) => {
42- const changelog = render ( { message : 'a: foo' } )
43- expect ( changelog ) . toMatch ( / a : f o o / )
44- } )
19+ describe ( '.render() with markdown' , ( ) => {
20+ const render = ( ...commits : Release . MockCommit [ ] ) => {
21+ // return Changelog.Renderers.Markdown.render(Changelog.fromSeries(Release.fromMockCommits(commits)))
22+ return Changelog . render ( Changelog . fromSeries ( Release . fromMockCommits ( commits ) ) , { as : 'markdown' } )
23+ }
24+ it ( 'renders release changelog for the current release series' , ( ) => {
25+ const changelog = render ( ...mockCommits )
26+ expect ( changelog ) . toMatchSnapshot ( )
4527 } )
28+ it ( 'shows breaking commits twice, once in breaking section and once in its native section' , ( ) => {
29+ const changelog = render ( { message : 'a: foo\n\nBREAKING CHANGE:\nbar' } )
30+ expect ( changelog ) . toMatch ( / B R E A K I N G C H A N G E S \n \n .* f o o / )
31+ expect ( changelog ) . toMatch ( / I m p r o v e m e n t s \n \n .* f o o / )
32+ } )
33+ it ( 'shows breaking label if commit breaking except within breaking section' , ( ) => {
34+ const changelog = render ( { message : 'a: foo\n\nBREAKING CHANGE:\nbar' } )
35+ expect ( changelog ) . toMatch ( / I m p r o v e m e n t s \n \n .* ( b r e a k i n g ) .* f o o / )
36+ } )
37+ it ( 'hides unknown section if no unknown commits' , ( ) => {
38+ const changelog = render ( { message : 'a: b' } )
39+ expect ( changelog ) . not . toMatch ( Changelog . empty ( ) . unspecified . label )
40+ } )
41+ it ( 'improvements section prefixes commits with their type' , ( ) => {
42+ const changelog = render ( { message : 'a: foo' } )
43+ expect ( changelog ) . toMatch ( / a : f o o / )
44+ } )
45+ } )
4646
47- describe ( 'termimal renderer option ' , ( ) => {
48- const render = ( ...commits : Release . MockCommit [ ] ) => {
49- return Changelog . Renderers . Terminal . render ( Changelog . fromSeries ( Release . fromMockCommits ( commits ) ) )
50- }
47+ describe ( '.render() with termimal ' , ( ) => {
48+ const render = ( ...commits : Release . MockCommit [ ] ) => {
49+ return Changelog . render ( Changelog . fromSeries ( Release . fromMockCommits ( commits ) ) , { as : 'plain' } )
50+ }
5151
52- it ( 'renders changelog for the current release series' , ( ) => {
53- const changelog = stripAnsi ( render ( ...mockCommits ) )
54- expect ( changelog ) . toMatchSnapshot ( )
55- } )
52+ it ( 'renders changelog for the current release series' , ( ) => {
53+ const changelog = stripAnsi ( render ( ...mockCommits ) )
54+ expect ( changelog ) . toMatchSnapshot ( )
5655 } )
5756} )
0 commit comments