public void ShouldUseFullHeaderAsSubjectIfNoTypeWasGivenButSubjectUsesColon() { var testCommit = new TestCommit("c360d6a307909c6e571b29d4a329fd786c5d4543", "broadcast $destroy event: on scope destruction"); var conventionalCommit = ConventionalCommitParser.Parse(testCommit); Assert.Equal(testCommit.Message, conventionalCommit.Subject); }
public void ShouldParseTypeScopeAndSubjectFromSingleLineCommitMessage() { var testCommit = new TestCommit("c360d6a307909c6e571b29d4a329fd786c5d4543", "feat(scope): broadcast $destroy event on scope destruction"); var conventionalCommit = ConventionalCommitParser.Parse(testCommit); Assert.Equal("feat", conventionalCommit.Type); Assert.Equal("scope", conventionalCommit.Scope); Assert.Equal("broadcast $destroy event on scope destruction", conventionalCommit.Subject); }
public void ShouldSupportExclamationMarkToSignifyingBreakingChanges(string commitMessage) { var testCommit = new TestCommit("c360d6a307909c6e571b29d4a329fd786c5d4543", commitMessage); var conventionalCommit = ConventionalCommitParser.Parse(testCommit); conventionalCommit.Notes.ShouldHaveSingleItem(); conventionalCommit.Notes[0].Title.ShouldBe("BREAKING CHANGE"); conventionalCommit.Notes[0].Text.ShouldBe(string.Empty); }
public void ShouldExtractCommitNotes() { var testCommit = new TestCommit("c360d6a307909c6e571b29d4a329fd786c5d4543", "feat(scope): broadcast $destroy: event on scope destruction\nBREAKING CHANGE: this will break rc1 compatibility"); var conventionalCommit = ConventionalCommitParser.Parse(testCommit); Assert.Single(conventionalCommit.Notes); var breakingChangeNote = conventionalCommit.Notes.Single(); Assert.Equal("BREAKING CHANGE", breakingChangeNote.Title); Assert.Equal("this will break rc1 compatibility", breakingChangeNote.Text); }