@@ -117,6 +117,7 @@ describe('project delete source', () => {
117
117
let lifecycleEmitStub : sinon . SinonStub ;
118
118
let resolveProjectConfigStub : sinon . SinonStub ;
119
119
let rmStub : sinon . SinonStub ;
120
+ let compSetFromSourceStub : sinon . SinonStub ;
120
121
121
122
class TestDelete extends Source {
122
123
public async runIt ( ) {
@@ -167,6 +168,10 @@ describe('project delete source', () => {
167
168
} ) ;
168
169
const lifecycle = Lifecycle . getInstance ( ) ;
169
170
lifecycleEmitStub = $$ . SANDBOX . stub ( lifecycle , 'emit' ) ;
171
+
172
+ compSetFromSourceStub = stubMethod ( $$ . SANDBOX , ComponentSet , 'fromSource' ) . returns ( {
173
+ toArray : ( ) => [ new SourceComponent ( exampleSourceComponent ) ] ,
174
+ } ) ;
170
175
} ) ;
171
176
172
177
afterEach ( ( ) => {
@@ -228,6 +233,23 @@ describe('project delete source', () => {
228
233
ensureHookArgs ( ) ;
229
234
} ) ;
230
235
236
+ it ( 'should pass along metadata and org for pseudo-type matching' , async ( ) => {
237
+ const metadata = [ 'Agent:My_Agent' ] ;
238
+ await runDeleteCmd ( [ '--metadata' , metadata [ 0 ] , '--json' ] ) ;
239
+ ensureCreateComponentSetArgs ( {
240
+ metadata : {
241
+ metadataEntries : metadata ,
242
+ directoryPaths : [ defaultPackagePath ] ,
243
+ } ,
244
+ org : {
245
+ username : testOrg . username ,
246
+ exclude : [ ] ,
247
+ } ,
248
+ } ) ;
249
+ ensureHookArgs ( ) ;
250
+ expect ( compSetFromSourceStub . calledOnce ) . to . be . true ;
251
+ } ) ;
252
+
231
253
it ( 'should pass along apiversion' , async ( ) => {
232
254
const metadata = [ 'ApexClass:MyClass' ] ;
233
255
0 commit comments