|
36831ec
mzgol authored
|
||
| 1 | /* global describe: false, it: false, expect: false */ | |
| 2 | ||
| 3 | 'use strict'; | |
| 4 | ||
|
4557881
vojtajina authored
|
||
| 5 | describe('changelog.js', function() { | |
| 6 | var ch = require('./changelog'); | |
| 7 | ||
| 8 | describe('parseRawCommit', function() { | |
| 9 | it('should parse raw commit', function() { | |
| 10 | var msg = ch.parseRawCommit( | |
| 11 | '9b1aff905b638aa274a5fc8f88662df446d374bd\n' + | |
| 12 | 'feat(scope): broadcast $destroy event on scope destruction\n' + | |
| 13 | 'perf testing shows that in chrome this change adds 5-15% overhead\n' + | |
| 14 | 'when destroying 10k nested scopes where each scope has a $destroy listener\n'); | |
| 15 | ||
| 16 | expect(msg.type).toBe('feat'); | |
| 17 | expect(msg.hash).toBe('9b1aff905b638aa274a5fc8f88662df446d374bd'); | |
| 18 | expect(msg.subject).toBe('broadcast $destroy event on scope destruction'); | |
| 19 | expect(msg.body).toBe('perf testing shows that in chrome this change adds 5-15% overhead\n' + | |
|
36831ec
mzgol authored
|
||
| 20 | 'when destroying 10k nested scopes where each scope has a $destroy listener\n'); | |
|
4557881
vojtajina authored
|
||
| 21 | expect(msg.component).toBe('scope'); | |
| 22 | }); | |
| 23 | ||
| 24 | ||
| 25 | it('should parse closed issues', function() { | |
| 26 | var msg = ch.parseRawCommit( | |
| 27 | '13f31602f396bc269076ab4d389cfd8ca94b20ba\n' + | |
| 28 | 'feat(ng-list): Allow custom separator\n' + | |
| 29 | 'bla bla bla\n\n' + | |
| 30 | 'Closes #123\nCloses #25\n'); | |
| 31 | ||
| 32 | expect(msg.closes).toEqual([123, 25]); | |
| 33 | }); | |
| 34 | ||
| 35 | ||
| 36 | it('should parse breaking changes', function() { | |
| 37 | var msg = ch.parseRawCommit( | |
| 38 | '13f31602f396bc269076ab4d389cfd8ca94b20ba\n' + | |
| 39 | 'feat(ng-list): Allow custom separator\n' + | |
| 40 | 'bla bla bla\n\n' + | |
|
07a58dd
IgorMinar authored
|
||
| 41 | 'BREAKING CHANGE: first breaking change\nsomething else\n' + | |
| 42 | 'another line with more info\n'); | |
|
4557881
vojtajina authored
|
||
| 43 | ||
|
07a58dd
IgorMinar authored
|
||
| 44 | expect(msg.breaking).toEqual(' first breaking change\nsomething else\nanother line with more info\n'); | |
|
4557881
vojtajina authored
|
||
| 45 | }); | |
| 46 | }); | |
| 47 | }); |