11const expect = require ( 'chai' ) . expect ;
22const sinon = require ( 'sinon' ) ;
33const fs = require ( 'fs-extra' ) ;
4+ const injectr = require ( 'injectr' ) ;
45
56describe ( 'cli : facade : validate' , ( ) => {
6- const ValidateFacade = require ( '../../dist/cli/facade/validate' ) . default ;
7+ const ValidateFacade = injectr ( '../../dist/cli/facade/validate.js' , {
8+ '../domain/handle-dependencies' : sinon . stub ( ) . resolves ( )
9+ } ) . default ;
710 let local ;
811 let registry ;
912 let logger ;
@@ -63,7 +66,7 @@ describe('cli : facade : validate', () => {
6366 } ) ;
6467 registry . validateComponent . resolves ( ) ;
6568 await validate ( {
66- componentPath : '/path/to/component '
69+ componentPath : 'test/fixtures/components/hello-world/ '
6770 } ) ;
6871 } ) ;
6972
@@ -89,7 +92,7 @@ describe('cli : facade : validate', () => {
8992 registry . get . resolves ( [ 'http://my-registry.com/' ] ) ;
9093 registry . validateComponent . resolves ( ) ;
9194 await validate ( {
92- componentPath : '/path/to/component ' ,
95+ componentPath : 'test/fixtures/components/hello-world/ ' ,
9396 skipPackage : true
9497 } ) ;
9598 } ) ;
@@ -119,7 +122,7 @@ describe('cli : facade : validate', () => {
119122 componentPath : '/path/to/component'
120123 } ) ;
121124 } catch ( err ) {
122- expect ( err ) . to . be . instanceOf ( Error ) ;
125+ expect ( err ) . to . contain ( 'Validation failed for registry ' ) ;
123126 }
124127 } ) ;
125128 } ) ;
0 commit comments