@@ -477,9 +477,6 @@ describe('bit lane command', function () {
477477 } ) ;
478478 } ) ;
479479 describe ( 'remove on lane with --update-main then merge to main' , ( ) => {
480- let localWs : string ;
481- let remoteScope : string ;
482- let headOnLane : string ;
483480 before ( ( ) => {
484481 helper . scopeHelper . setWorkspaceWithRemoteScope ( ) ;
485482 helper . fixtures . populateComponents ( 1 , false ) ;
@@ -488,67 +485,33 @@ describe('bit lane command', function () {
488485 helper . command . createLane ( ) ;
489486 helper . command . softRemoveOnLane ( 'comp1' , '--update-main' ) ;
490487 helper . command . snapAllComponentsWithoutBuild ( ) ;
491- headOnLane = helper . command . getHeadOfLane ( 'dev' , 'comp1' ) ;
492488 helper . command . export ( ) ;
493- localWs = helper . scopeHelper . cloneWorkspace ( ) ;
494- remoteScope = helper . scopeHelper . cloneRemoteScope ( ) ;
489+ helper . command . switchLocalLane ( 'main' , '-x' ) ;
490+ helper . command . mergeLane ( 'dev' , '-x' ) ;
495491 } ) ;
496- describe ( 'merge from the workspace' , ( ) => {
492+ it ( 'should be marked as removed on main' , ( ) => {
493+ const removeData = helper . command . showAspectConfig ( 'comp1' , Extensions . remove ) ;
494+ expect ( removeData . config . removed ) . to . be . true ;
495+ } ) ;
496+ it ( 'bit status should show the component as staged' , ( ) => {
497+ const status = helper . command . statusJson ( ) ;
498+ expect ( status . stagedComponents ) . to . have . lengthOf ( 1 ) ;
499+ } ) ;
500+ it ( 'bitmap should not have the component' , ( ) => {
501+ const bitMap = helper . bitMap . read ( ) ;
502+ expect ( bitMap ) . to . not . have . property ( 'comp1' ) ;
503+ } ) ;
504+ describe ( 'export and import the component to a new workspace' , ( ) => {
497505 before ( ( ) => {
498- helper . command . switchLocalLane ( 'main' , '-x' ) ;
499- helper . command . mergeLane ( 'dev' , '-x' ) ;
506+ helper . command . export ( ) ;
507+ helper . scopeHelper . reInitWorkspace ( ) ;
508+ helper . scopeHelper . addRemoteScope ( ) ;
509+ helper . command . importComponent ( 'comp1' , '-x' ) ;
500510 } ) ;
501- it ( 'should be marked as removed on main ' , ( ) => {
511+ it ( 'should show the component as removed' , ( ) => {
502512 const removeData = helper . command . showAspectConfig ( 'comp1' , Extensions . remove ) ;
503513 expect ( removeData . config . removed ) . to . be . true ;
504514 } ) ;
505- it ( 'bit status should show the component as staged' , ( ) => {
506- const status = helper . command . statusJson ( ) ;
507- expect ( status . stagedComponents ) . to . have . lengthOf ( 1 ) ;
508- } ) ;
509- it ( 'bitmap should not have the component' , ( ) => {
510- const bitMap = helper . bitMap . read ( ) ;
511- expect ( bitMap ) . to . not . have . property ( 'comp1' ) ;
512- } ) ;
513- describe ( 'export and import the component to a new workspace' , ( ) => {
514- before ( ( ) => {
515- helper . command . export ( ) ;
516- helper . scopeHelper . reInitWorkspace ( ) ;
517- helper . scopeHelper . addRemoteScope ( ) ;
518- helper . command . importComponent ( 'comp1' , '-x' ) ;
519- } ) ;
520- it ( 'should show the component as removed' , ( ) => {
521- const removeData = helper . command . showAspectConfig ( 'comp1' , Extensions . remove ) ;
522- expect ( removeData . config . removed ) . to . be . true ;
523- } ) ;
524- } ) ;
525- } ) ;
526- describe ( 'merge from scope' , ( ) => {
527- let bareMerge ;
528- let mergeOutput : string ;
529- before ( ( ) => {
530- helper . scopeHelper . getClonedWorkspace ( localWs ) ;
531- helper . scopeHelper . getClonedRemoteScope ( remoteScope ) ;
532- bareMerge = helper . scopeHelper . getNewBareScope ( '-bare-merge' ) ;
533- helper . scopeHelper . addRemoteScope ( helper . scopes . remotePath , bareMerge . scopePath ) ;
534- mergeOutput = helper . command . mergeLaneFromScope ( bareMerge . scopePath , `${ helper . scopes . remote } /dev` ) ;
535- } ) ;
536- it ( 'should indicate in the output the new head, not the only one' , ( ) => {
537- expect ( mergeOutput ) . to . have . string ( headOnLane ) ;
538- expect ( mergeOutput ) . to . not . have . string ( '0.0.1' ) ;
539- } ) ;
540- it ( 'should merge successfully to main' , ( ) => {
541- const headOnMain = helper . command . getHead ( 'comp1' , bareMerge . scopePath ) ;
542- expect ( headOnMain ) . to . equal ( headOnLane ) ;
543- } ) ;
544- it ( 'should be marked as removed on main' , ( ) => {
545- const removeData = helper . command . showAspectConfig (
546- `${ helper . scopes . remote } /comp1` ,
547- Extensions . remove ,
548- bareMerge . scopePath
549- ) ;
550- expect ( removeData . config . removed ) . to . be . true ;
551- } ) ;
552515 } ) ;
553516 } ) ;
554517 describe ( 'remove on lane with --update-main then merge to another lane' , ( ) => {
0 commit comments