-
Notifications
You must be signed in to change notification settings - Fork 929
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce new flags
--dependents
and --dependencies
for bit show
(
#1914) * introduce new flags --dependents and --dependencies for "bit show" to display them all recursively (implements a part of #1885). * add e2e-test for the `show` api
- Loading branch information
1 parent
91515da
commit 2d3d898
Showing
23 changed files
with
646 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { expect } from 'chai'; | ||
import Helper from '../e2e-helper'; | ||
import * as api from '../../src/api'; | ||
|
||
describe('show api', function () { | ||
this.timeout(0); | ||
const helper = new Helper(); | ||
after(() => { | ||
helper.destroyEnv(); | ||
}); | ||
describe('show()', () => { | ||
before(() => { | ||
helper.setNewLocalAndRemoteScopes(); | ||
helper.createComponentBarFoo(); | ||
helper.addComponentBarFoo(); | ||
helper.tagAllComponents(); | ||
helper.tagScope('1.0.0'); | ||
helper.exportAllComponents(); | ||
}); | ||
describe('with no options', () => { | ||
it('should return an object of the component with the latest version', async () => { | ||
const result = await api.show(helper.remoteScopePath, `${helper.remoteScope}/bar/[email protected]`); | ||
expect(result).to.be.an('object'); | ||
expect(result) | ||
.to.have.property('name') | ||
.that.equals('bar/foo'); | ||
}); | ||
}); | ||
describe('with versions = true', () => { | ||
it('should return an array of all versions of the component', async () => { | ||
const result = await api.show(helper.remoteScopePath, `${helper.remoteScope}/bar/[email protected]`, { | ||
versions: true | ||
}); | ||
expect(result) | ||
.to.be.an('array') | ||
.with.lengthOf(2); | ||
expect(result[0]) | ||
.to.have.property('name') | ||
.that.equals('bar/foo'); | ||
expect(result[0]) | ||
.to.have.property('version') | ||
.that.equals('0.0.1'); | ||
expect(result[1]) | ||
.to.have.property('name') | ||
.that.equals('bar/foo'); | ||
expect(result[1]) | ||
.to.have.property('version') | ||
.that.equals('1.0.0'); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.