@@ -117,6 +117,29 @@ test("createWorkspace: Using invalid object", async (t) => {
117
117
"Threw with validation error" ) ;
118
118
} ) ;
119
119
120
+ test ( "createWorkspace: Using name and object with different workspace name" , async ( t ) => {
121
+ const { createWorkspace} = t . context ;
122
+
123
+ const err = await t . throwsAsync ( createWorkspace ( {
124
+ cwd : "cwd" ,
125
+ name : "my-workspace" ,
126
+ configObject : {
127
+ metadata : {
128
+ name : "my-other-workspace"
129
+ } ,
130
+ dependencyManagement : {
131
+ resolutions : [ {
132
+ path : "resolution/path"
133
+ } ]
134
+ }
135
+ }
136
+ } ) ) ;
137
+ t . is ( err . message ,
138
+ `The provided workspace name 'my-workspace' does not match ` +
139
+ `the provided workspace configuration 'my-other-workspace'` ,
140
+ "Threw with validation error" ) ;
141
+ } ) ;
142
+
120
143
test ( "createWorkspace: Using file" , async ( t ) => {
121
144
const { createWorkspace, MockWorkspace, workspaceConstructorStub} = t . context ;
122
145
@@ -171,6 +194,20 @@ test("createWorkspace: Using missing file", async (t) => {
171
194
t . is ( workspaceConstructorStub . callCount , 0 , "Workspace constructor did not get called" ) ;
172
195
} ) ;
173
196
197
+ test ( "createWorkspace: Missing default workspace in file" , async ( t ) => {
198
+ const { createWorkspace, workspaceConstructorStub} = t . context ;
199
+
200
+ const res = await createWorkspace ( {
201
+ cwd : path . join ( fixturesPath , "library.h" ) ,
202
+ name : "default" ,
203
+ configPath : path . join ( fixturesPath , "library.h" , "custom-ui5-workspace.yaml" )
204
+ } ) ;
205
+
206
+ t . is ( res , null , "Returned no workspace" ) ;
207
+
208
+ t . is ( workspaceConstructorStub . callCount , 0 , "Workspace constructor did not get called" ) ;
209
+ } ) ;
210
+
174
211
test ( "createWorkspace: Using missing file and non-default name" , async ( t ) => {
175
212
const { createWorkspace, workspaceConstructorStub} = t . context ;
176
213
0 commit comments