@@ -540,6 +540,7 @@ func TestStartUnstagedChanges(t *testing.T) {
540540 assertOnBranch (t , "master" )
541541 assertNoMobSessionBranches (t , configuration , "mob-session" )
542542 assertOutputContains (t , output , "mob start --include-uncommitted-changes" )
543+ assertOutputContains (t , output , "mob start --discard-uncommitted-changes" )
543544}
544545
545546func TestStartIncludeUnstagedChanges (t * testing.T ) {
@@ -553,6 +554,18 @@ func TestStartIncludeUnstagedChanges(t *testing.T) {
553554 assertMobSessionBranches (t , configuration , "mob-session" )
554555}
555556
557+ func TestStartDiscardUnstagedChanges (t * testing.T ) {
558+ _ , configuration := setup (t )
559+ configuration .StartDiscardUncommittedChanges = true
560+ createFile (t , "test.txt" , "contentIrrelevant" )
561+
562+ start (configuration )
563+
564+ assertOnBranch (t , "mob-session" )
565+ assertMobSessionBranches (t , configuration , "mob-session" )
566+ assertCleanGitStatus (t )
567+ }
568+
556569func TestStartIncludeUnstagedChangesInNewWorkingDirectory (t * testing.T ) {
557570 output , configuration := setup (t )
558571 configuration .StartIncludeUncommittedChanges = true
@@ -625,6 +638,7 @@ func TestStartOnUnpushedFeatureBranchWithUncommitedChanges(t *testing.T) {
625638
626639 assertOnBranch (t , "feature1" )
627640 assertOutputContains (t , output , "mob start --include-uncommitted-changes" )
641+ assertOutputContains (t , output , "mob start --discard-uncommitted-changes" )
628642}
629643
630644func TestStartCreateOnUnpushedFeatureBranch (t * testing.T ) {
@@ -660,6 +674,7 @@ func TestStartCreateOnUnpushedFeatureBranchWithUncommitedChanges(t *testing.T) {
660674
661675 assertOutputContains (t , output , "To start, including uncommitted changes and create the remote branch, use" )
662676 assertOutputContains (t , output , "mob start --create --include-uncommitted-changes" )
677+ assertOutputContains (t , output , "mob start --create --discard-uncommitted-changes" )
663678}
664679
665680func TestStartCreateIncludeUncommitedChangesOnUnpushedFeatureBranchWithUncommitedChanges (t * testing.T ) {
@@ -1521,6 +1536,7 @@ func TestStartBranchWithUncommitedChangesFixWithBranch(t *testing.T) {
15211536 runMob (t , tempDir + "/local" , "start" , "-b" , "green" )
15221537
15231538 assertOutputContains (t , output , "mob start --branch green --include-uncommitted-changes" )
1539+ assertOutputContains (t , output , "mob start --branch green --discard-uncommitted-changes" )
15241540 resetExit ()
15251541}
15261542
@@ -1534,6 +1550,7 @@ func TestStartBranchEnvWithUncommitedChangesFixWithoutBranch(t *testing.T) {
15341550 runMob (t , tempDir + "/local" , "start" )
15351551
15361552 assertOutputContains (t , output , "mob start --include-uncommitted-changes" )
1553+ assertOutputContains (t , output , "mob start --discard-uncommitted-changes" )
15371554 resetExit ()
15381555}
15391556
@@ -1548,6 +1565,7 @@ func TestStartCreateBranchWithUncommitedChangesFixWithBranch(t *testing.T) {
15481565 runMob (t , tempDir + "/local" , "start" , "--create" , "-b" , "green" )
15491566
15501567 assertOutputContains (t , output , "mob start --create --branch green --include-uncommitted-changes" )
1568+ assertOutputContains (t , output , "mob start --create --branch green --discard-uncommitted-changes" )
15511569 resetExit ()
15521570}
15531571
@@ -1563,6 +1581,7 @@ func TestStartCreateBranchEnvWithUncommitedChangesFixWithoutBranch(t *testing.T)
15631581
15641582 os .Unsetenv ("MOB_WIP_BRANCH_QUALIFIER" )
15651583 assertOutputContains (t , output , "mob start --create --include-uncommitted-changes" )
1584+ assertOutputContains (t , output , "mob start --create --discard-uncommitted-changes" )
15661585 resetExit ()
15671586}
15681587
0 commit comments