Skip to content
Permalink
Browse files
fix: clean command (#815)
* fix clean command
* added unit tests for the getArgs clean
* Cleaned up ProjectBuilder.getArgs for readability
  • Loading branch information
breautek authored and erisu committed Sep 7, 2019
1 parent c93e3e9 commit 1b1120617418f7152bc9d63f5a643b2fa19f0179
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
@@ -45,8 +45,8 @@ class ProjectBuilder {

getArgs (cmd, opts) {
let args;
let buildCmd = cmd;
if (opts.packageType === PackageType.BUNDLE) {
let buildCmd;
if (cmd === 'release') {
buildCmd = ':app:bundleRelease';
} else if (cmd === 'debug') {
@@ -55,7 +55,6 @@ class ProjectBuilder {

args = [buildCmd, '-b', path.join(this.root, 'build.gradle')];
} else {
let buildCmd;
if (cmd === 'release') {
buildCmd = 'cdvBuildRelease';
} else if (cmd === 'debug') {
@@ -100,6 +100,20 @@ describe('ProjectBuilder', () => {

expect(args).toContain(`-PcdvBuildArch=${arch}`);
});

it('should clean apk', () => {
const args = builder.getArgs('clean', {
packageType: 'apk'
});
expect(args[0]).toBe('clean');
});

it('should clean bundle', () => {
const args = builder.getArgs('clean', {
packageType: 'bundle'
});
expect(args[0]).toBe('clean');
});
});

describe('runGradleWrapper', () => {

0 comments on commit 1b11206

Please sign in to comment.