Fixes build & run related bugs from builder refactor PR #461 (#490)

- General Code Refactor
- Removed builder type argument from getBuilder API
- Removed any reference of conditional statements around builder type
- Remove plugin handler install and uninstall option flag android_studio
- Remove --gradle flag references
- Fixed plugin handler install and uninstall pathing issues
- Added parseBuildOptions export so run can get build related options.
- Use the nobuild flag option to control the run build.
- Updated test spec to reflect the changes.
This commit is contained in:
エリス
2018-09-06 11:06:18 +09:00
committed by GitHub
parent 7ab0cf123d
commit 23b24491c3
13 changed files with 81 additions and 192 deletions
+2 -11
View File
@@ -31,24 +31,15 @@ describe('builders', () => {
describe('getBuilder', () => {
it('should return an instance of ProjectBuilder when gradle is requested', () => {
const newBuilder = builders.getBuilder('gradle');
const newBuilder = builders.getBuilder();
expect(newBuilder).toEqual(jasmine.any(ProjectBuilder));
});
it('should return an instance of ProjectBuilder when studio is requested', () => {
const newBuilder = builders.getBuilder('studio');
expect(newBuilder).toEqual(jasmine.any(ProjectBuilder));
});
it('should throw an error if the selected builder does not exist', () => {
expect(() => builders.getBuilder('NonExistentBuilder')).toThrow(jasmine.any(CordovaError));
});
it('should throw an error if a builder cannot be instantiated', () => {
const requireSpy = jasmine.createSpy('require').and.throwError();
builders.__set__('require', requireSpy);
expect(() => builders.getBuilder('gradle')).toThrow(jasmine.any(CordovaError));
expect(() => builders.getBuilder()).toThrow(jasmine.any(CordovaError));
});
});
});