Skip to content

Commit 9d706c3

Browse files
fix tests
1 parent ef10894 commit 9d706c3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/unit/cli-facade-validate.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
const expect = require('chai').expect;
22
const sinon = require('sinon');
33
const fs = require('fs-extra');
4+
const injectr = require('injectr');
45

56
describe('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

Comments
 (0)