Skip to content

Commit

Permalink
resolve part of #2341, enable "--all" flag when "--all-versions" is u…
Browse files Browse the repository at this point in the history
…sed and vice versa, to enable re-exporting a component after deleting it
  • Loading branch information
davidfirst committed Feb 13, 2020
1 parent 26c53a4 commit 98ec60d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [unreleased]

- [#2341](/~https://github.com/teambit/bit/issues/2341) fix `bit export --all` to successfully export when deleted from remote
- support configuring the logger level by running `bit config set log_level <level>`.
- [#2268](/~https://github.com/teambit/bit/issues/2268) prevent logger from holding the terminal once a command is completed

Expand Down
35 changes: 35 additions & 0 deletions e2e/commands/export.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1208,4 +1208,39 @@ describe('bit export command', function() {
expect(list).to.have.lengthOf(1);
});
});
describe('export after re-creating the remote', () => {
before(() => {
helper.scopeHelper.setNewLocalAndRemoteScopes();
helper.fixtures.populateWorkspaceWithUtilsIsType();
helper.command.tagAllComponents();
helper.command.exportAllComponents();
helper.scopeHelper.reInitRemoteScope();
});
describe('export without any flag', () => {
it('should show a message that nothing to export', () => {
const output = helper.command.exportAllComponents();
expect(output).to.have.string('nothing to export');
});
});
describe('export with --all flag', () => {
before(() => {
helper.scopeHelper.reInitRemoteScope();
helper.command.export(`${helper.scopes.remote} ${helper.scopes.remote}/* --all`);
});
it('should export them successfully', () => {
const list = helper.command.listRemoteScopeParsed();
expect(list).to.have.lengthOf(1);
});
});
describe('export with --all flag', () => {
before(() => {
helper.scopeHelper.reInitRemoteScope();
helper.command.export(`${helper.scopes.remote} ${helper.scopes.remote}/* --all-versions`);
});
it('should export them successfully', () => {
const list = helper.command.listRemoteScopeParsed();
expect(list).to.have.lengthOf(1);
});
});
});
});
4 changes: 2 additions & 2 deletions src/cli/commands/public-cmds/export-cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export default class Export extends Command {
eject,
includeDependencies,
setCurrentScope,
includeNonStaged: all,
allVersions,
includeNonStaged: all || allVersions,
allVersions: allVersions || all,
codemod: rewire,
force
}).then(results => ({
Expand Down

0 comments on commit 98ec60d

Please sign in to comment.