-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e79c0d0
commit 39e9b06
Showing
5 changed files
with
108 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use rstest::rstest; | ||
|
||
use crate::increment::*; | ||
|
||
#[rstest( | ||
commit_message, | ||
case("refactor(ts)!: ship yargs.d.ts (#1671)\n\nBREAKING CHANGE: yargs now ships with its own types"), | ||
case("chore: upgrade yargs-parser (#633)\n\n* chore: upgrade yargs-parser\r\nBREAKING CHANGE: coerce is now applied as a final step after other parsing is complete\r\n\r\n* add documentation for breaking changes in yargs-parser@4\r\n\r\n* fix: a few small editing nits\r\n\r\n* fix: bump yargs-parser again\r\n"), | ||
case("fix!: calling parse multiple times now appropriately maintains state (#1137) (#1369)\n\nBREAKING CHANGE: previously to this fix methods like `yargs.getOptions()` contained the state of the last command to execute."), | ||
case("fix(default): Remove undocumented alias of default() (#469)\n\nBREAKING CHANGE:\r\n\r\nremoved undocumented `defaults` alias for `default`.\r\n\r\n"), | ||
case("feat: apply default builder to command() and apply fail() handlers globally (#583)\n\nBREAKING CHANGE: fail is now applied globally.\r\nBREAKING CHANGE: we now default to an empty builder function when command is executed with no builder."), | ||
case("feat: tweaks to API surface based on user feedback (#1726)\n\nBREAKING CHANGE: tweaks to ESM/Deno API surface: now exports yargs function by default; getProcessArgvWithoutBin becomes hidBin; types now exported for Deno."), | ||
)] | ||
fn test_is_major_footer_increment(commit_message: &str) { | ||
assert!(is_major_footer_increment(commit_message)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,2 @@ | ||
use rstest::rstest; | ||
|
||
use crate::increment::*; | ||
|
||
#[rstest( | ||
commit_message, | ||
case("refactor!: drop support for Node 6"), | ||
case("feat(deps)!: pull in [email protected] (#1553)\n\n") | ||
)] | ||
fn test_is_major_increment(commit_message: &str) { | ||
assert_eq!(true, is_major_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case("build!(deps): updating build deps to latest versions") | ||
)] | ||
fn test_is_major_increment_invalid_preceding_exclamation(commit_message: &str) { | ||
assert_eq!(true, is_major_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case("feat(yargs-parser)!: introduce single-digit boolean aliases (#1576)\n\n"), | ||
case("feat(yargs parser)!: introduce single-digit boolean aliases (#1576)\n\n"), | ||
case("feat(yargs_parser)!: introduce single-digit boolean aliases (#1576)\n\n") | ||
)] | ||
fn test_is_major_increment_invalid_scope(commit_message: &str) { | ||
assert_eq!(true, is_major_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case("fix(default): Remove undocumented alias of default() (#469)\n\nBREAKING CHANGE:\r\n\r\nremoved undocumented `defaults` alias for `default`.\r\n\r\n"), | ||
case("feat: apply default builder to command() and apply fail() handlers globally (#583)\n\nBREAKING CHANGE: fail is now applied globally.\r\nBREAKING CHANGE: we now default to an empty builder function when command is executed with no builder."), | ||
case("feat: tweaks to API surface based on user feedback (#1726)\n\nBREAKING CHANGE: tweaks to ESM/Deno API surface: now exports yargs function by default; getProcessArgvWithoutBin becomes hidBin; types now exported for Deno."), | ||
)] | ||
fn test_is_major_increment_footer(commit_message: &str) { | ||
assert_eq!(true, is_major_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case("build: switch to action for release-please (#1657)"), | ||
case("chore(ts): tsify lib/middleware (#1636)\n\n"), | ||
case("fix(i18n): Japanese translation phrasing (#1619)\n\n"), | ||
case("feat: add usage for single-digit boolean aliases (#1580)\n\n") | ||
)] | ||
fn test_is_not_major_increment(commit_message: &str) { | ||
assert_eq!(false, is_major_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case(" refactor!: drop support for Node 6"), | ||
case("\tfeat(deps)!: pull in [email protected] (#1553)\n\n") | ||
)] | ||
fn test_is_major_increment_preceding_whitespace(commit_message: &str) { | ||
assert_eq!(true, is_major_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case("\n\rbuild: switch to action for release-please (#1657)"), | ||
case(" chore(ts): tsify lib/middleware (#1636)\n\n"), | ||
case(" fix(i18n): Japanese translation phrasing (#1619)\n\n"), | ||
case("\tfeat: add usage for single-digit boolean aliases (#1580)\n\n") | ||
)] | ||
fn test_is_not_major_increment_preceding_whitespace(commit_message: &str) { | ||
assert_eq!(false, is_major_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case("refactor( )!: drop support for Node 6"), | ||
case("feat()!: pull in [email protected] (#1553)\n\n") | ||
)] | ||
fn test_is_major_increment_empty_scope(commit_message: &str) { | ||
assert_eq!(true, is_major_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case("build( ): switch to action for release-please (#1657)"), | ||
case("chore(): tsify lib/middleware (#1636)\n\n"), | ||
case("fix( ): Japanese translation phrasing (#1619)\n\n") | ||
)] | ||
fn test_is_not_major_increment_empty_scope(commit_message: &str) { | ||
assert_eq!(false, is_major_increment(commit_message)); | ||
} | ||
mod body; | ||
mod title; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
use rstest::rstest; | ||
|
||
use crate::increment::*; | ||
|
||
#[rstest( | ||
commit_message, | ||
case("refactor!: drop support for Node 6"), | ||
case("feat(deps)!: pull in [email protected] (#1553)\n\n") | ||
)] | ||
fn test_is_major_title_increment(commit_message: &str) { | ||
assert!(is_major_title_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case("build!(deps): updating build deps to latest versions") | ||
)] | ||
fn test_is_major_title_increment_invalid_preceding_exclamation(commit_message: &str) { | ||
assert!(is_major_title_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case("feat(yargs-parser)!: introduce single-digit boolean aliases (#1576)\n\n"), | ||
case("feat(yargs parser)!: introduce single-digit boolean aliases (#1576)\n\n"), | ||
case("feat(yargs_parser)!: introduce single-digit boolean aliases (#1576)\n\n") | ||
)] | ||
fn test_is_major_title_increment_invalid_scope(commit_message: &str) { | ||
assert!(is_major_title_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case(" refactor!: drop support for Node 6"), | ||
case("\tfeat(deps)!: pull in [email protected] (#1553)\n\n") | ||
)] | ||
fn test_is_major_title_increment_preceding_whitespace(commit_message: &str) { | ||
assert!(is_major_title_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case("build: switch to action for release-please (#1657)"), | ||
case("chore(ts): tsify lib/middleware (#1636)\n\n"), | ||
case("fix(i18n): Japanese translation phrasing (#1619)\n\n"), | ||
case("feat: add usage for single-digit boolean aliases (#1580)\n\n") | ||
)] | ||
fn test_is_not_major_title_increment(commit_message: &str) { | ||
assert_eq!(false, is_major_title_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case("\n\rbuild: switch to action for release-please (#1657)"), | ||
case(" chore(ts): tsify lib/middleware (#1636)\n\n"), | ||
case(" fix(i18n): Japanese translation phrasing (#1619)\n\n"), | ||
case("\tfeat: add usage for single-digit boolean aliases (#1580)\n\n") | ||
)] | ||
fn test_is_not_major_title_increment_preceding_whitespace(commit_message: &str) { | ||
assert_eq!(false, is_major_title_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case("refactor( )!: drop support for Node 6"), | ||
case("feat()!: pull in [email protected] (#1553)\n\n") | ||
)] | ||
fn test_is_major_title_increment_empty_scope(commit_message: &str) { | ||
assert!(is_major_title_increment(commit_message)); | ||
} | ||
|
||
#[rstest( | ||
commit_message, | ||
case("build( ): switch to action for release-please (#1657)"), | ||
case("chore(): tsify lib/middleware (#1636)\n\n"), | ||
case("fix( ): Japanese translation phrasing (#1619)\n\n") | ||
)] | ||
fn test_is_not_major_title_increment_empty_scope(commit_message: &str) { | ||
assert_eq!(false, is_major_title_increment(commit_message)); | ||
} |