@@ -41,6 +41,56 @@ describe('main', () => {
41
41
} ) ;
42
42
} ) ;
43
43
44
+ for ( const [ description , directoryPath ] of [
45
+ [ 'directories with spaces' , '/path/to/my project' ] ,
46
+ [ 'directories with quote' , "/path/to/my 'project" ] ,
47
+ [ 'directories with quotes' , "/path/to/my 'proje'ct" ] ,
48
+ [ 'directories with double-quote' , '/path/to/my "project' ] ,
49
+ [ 'directories with double-quotes' , '/path/to/my "proje"ct' ] ,
50
+ [
51
+ 'directories with special characters' ,
52
+ '/path/~to/#my/!y \'\\"\\pr@j/e"ct' ,
53
+ ] ,
54
+ ] ) {
55
+ const tempDirectoryPath = directoryPath . replace ( / ^ \/ p a t h \/ / u, '/tmp/' ) ;
56
+ const cwd = directoryPath . replace ( / ^ \/ p a t h \/ / u, '/workdir/' ) ;
57
+ it ( `executes the monorepo workflow for ${ description } ` , async ( ) => {
58
+ const project = buildMockProject ( {
59
+ directoryPath,
60
+ isMonorepo : true ,
61
+ } ) ;
62
+ const stdout = fs . createWriteStream ( '/dev/null' ) ;
63
+ const stderr = fs . createWriteStream ( '/dev/null' ) ;
64
+ jest
65
+ . spyOn ( initialParametersModule , 'determineInitialParameters' )
66
+ . mockResolvedValue ( {
67
+ project,
68
+ tempDirectoryPath,
69
+ reset : true ,
70
+ releaseType : 'backport' ,
71
+ } ) ;
72
+ const followMonorepoWorkflowSpy = jest
73
+ . spyOn ( monorepoWorkflowOperations , 'followMonorepoWorkflow' )
74
+ . mockResolvedValue ( ) ;
75
+
76
+ await main ( {
77
+ argv : [ ] ,
78
+ cwd,
79
+ stdout,
80
+ stderr,
81
+ } ) ;
82
+
83
+ expect ( followMonorepoWorkflowSpy ) . toHaveBeenCalledWith ( {
84
+ project,
85
+ tempDirectoryPath,
86
+ firstRemovingExistingReleaseSpecification : true ,
87
+ releaseType : 'backport' ,
88
+ stdout,
89
+ stderr,
90
+ } ) ;
91
+ } ) ;
92
+ }
93
+
44
94
it ( 'executes the polyrepo workflow if the project is within a polyrepo' , async ( ) => {
45
95
const project = buildMockProject ( { isMonorepo : false } ) ;
46
96
const stdout = fs . createWriteStream ( '/dev/null' ) ;
0 commit comments