mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
Fix boolean logic (#129)
This commit is contained in:
parent
e003f9e2ca
commit
1f8d196ed0
@ -64,7 +64,7 @@ inputs:
|
|||||||
description: 'The android versionCode'
|
description: 'The android versionCode'
|
||||||
androidAppBundle:
|
androidAppBundle:
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: 'false'
|
||||||
description: 'Whether to build .aab instead of .apk'
|
description: 'Whether to build .aab instead of .apk'
|
||||||
androidKeystoreName:
|
androidKeystoreName:
|
||||||
required: false
|
required: false
|
||||||
|
File diff suppressed because one or more lines are too long
@ -46,9 +46,9 @@ class Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static get androidAppBundle() {
|
static get androidAppBundle() {
|
||||||
const input = core.getInput('androidAppBundle') || 'false';
|
const input = core.getInput('androidAppBundle') || false;
|
||||||
|
|
||||||
return input === 'true' ? 'true' : 'false';
|
return input === 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
static get androidKeystoreName() {
|
static get androidKeystoreName() {
|
||||||
@ -72,9 +72,9 @@ class Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static get allowDirtyBuild() {
|
static get allowDirtyBuild() {
|
||||||
const input = core.getInput('allowDirtyBuild') || 'false';
|
const input = core.getInput('allowDirtyBuild') || false;
|
||||||
|
|
||||||
return input === 'true' ? 'true' : 'false';
|
return input === 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
static get customParameters() {
|
static get customParameters() {
|
||||||
|
@ -133,18 +133,18 @@ describe('Input', () => {
|
|||||||
|
|
||||||
describe('androidAppBundle', () => {
|
describe('androidAppBundle', () => {
|
||||||
it('returns the default value', () => {
|
it('returns the default value', () => {
|
||||||
expect(Input.androidAppBundle).toStrictEqual('false');
|
expect(Input.androidAppBundle).toStrictEqual(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns true when string true is passed', () => {
|
it('returns true when string true is passed', () => {
|
||||||
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
|
||||||
expect(Input.androidAppBundle).toStrictEqual('true');
|
expect(Input.androidAppBundle).toStrictEqual(true);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false when string false is passed', () => {
|
it('returns false when string false is passed', () => {
|
||||||
const spy = jest.spyOn(core, 'getInput').mockReturnValue('false');
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('false');
|
||||||
expect(Input.androidAppBundle).toStrictEqual('false');
|
expect(Input.androidAppBundle).toStrictEqual(false);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -216,18 +216,18 @@ describe('Input', () => {
|
|||||||
|
|
||||||
describe('allowDirtyBuild', () => {
|
describe('allowDirtyBuild', () => {
|
||||||
it('returns the default value', () => {
|
it('returns the default value', () => {
|
||||||
expect(Input.allowDirtyBuild).toStrictEqual('false');
|
expect(Input.allowDirtyBuild).toStrictEqual(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns true when string true is passed', () => {
|
it('returns true when string true is passed', () => {
|
||||||
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
|
||||||
expect(Input.allowDirtyBuild).toStrictEqual('true');
|
expect(Input.allowDirtyBuild).toStrictEqual(true);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false when string false is passed', () => {
|
it('returns false when string false is passed', () => {
|
||||||
const spy = jest.spyOn(core, 'getInput').mockReturnValue('false');
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('false');
|
||||||
expect(Input.allowDirtyBuild).toStrictEqual('false');
|
expect(Input.allowDirtyBuild).toStrictEqual(false);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -10,7 +10,7 @@ export default class Versioning {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static get isDirtyAllowed() {
|
static get isDirtyAllowed() {
|
||||||
return Input.allowDirtyBuild === 'true';
|
return Input.allowDirtyBuild;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get strategies() {
|
static get strategies() {
|
||||||
|
Loading…
Reference in New Issue
Block a user