mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-30 00:00:04 +08:00
feat: support adding project build script dependencies
This commit is contained in:
@@ -197,6 +197,7 @@ describe('android project handler', function () {
|
||||
spyOn(dummyProject, 'addSystemLibrary');
|
||||
spyOn(dummyProject, 'addSubProject');
|
||||
spyOn(dummyProject, 'addGradleReference');
|
||||
spyOn(dummyProject, 'addAppBuildScriptDependency');
|
||||
common.__set__('copyNewFile', copyNewFileSpy);
|
||||
});
|
||||
|
||||
@@ -241,6 +242,12 @@ describe('android project handler', function () {
|
||||
expect(copyNewFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, framework.src, dummyProject.projectDir, someString, false);
|
||||
expect(dummyProject.addGradleReference).toHaveBeenCalledWith(dummyProject.projectDir, someString);
|
||||
});
|
||||
|
||||
it('Test#013 : should install app buildscript dependency using project.addAppBuildScriptDependency', () => {
|
||||
const framework = { src: 'plugin-dependency', type: 'appBuildScriptDependency' };
|
||||
android.framework.install(framework, dummyPluginInfo, dummyProject);
|
||||
expect(dummyProject.addAppBuildScriptDependency).toHaveBeenCalledWith(dummyProject.projectDir, someString);
|
||||
});
|
||||
});
|
||||
|
||||
describe('of <js-module> elements', function () {
|
||||
@@ -402,6 +409,7 @@ describe('android project handler', function () {
|
||||
spyOn(dummyProject, 'removeSystemLibrary');
|
||||
spyOn(dummyProject, 'removeSubProject');
|
||||
spyOn(dummyProject, 'removeGradleReference');
|
||||
spyOn(dummyProject, 'removeAppBuildScriptDependency');
|
||||
});
|
||||
|
||||
it('Test#020 : should throw if framework doesn\'t have "src" attribute', function () {
|
||||
@@ -433,6 +441,12 @@ describe('android project handler', function () {
|
||||
expect(rmSyncSpy).toHaveBeenCalledWith(someString, { recursive: true, force: true });
|
||||
expect(dummyProject.removeGradleReference).toHaveBeenCalledWith(dummyProject.projectDir, someString);
|
||||
});
|
||||
|
||||
it('Test#025 : should uninstall app buildscript dependency using project.removeAppBuildScriptDependency', () => {
|
||||
const framework = { src: 'plugin-dependency', type: 'appBuildScriptDependency' };
|
||||
android.framework.uninstall(framework, dummyPluginInfo, dummyProject);
|
||||
expect(dummyProject.removeAppBuildScriptDependency).toHaveBeenCalledWith(dummyProject.projectDir, someString);
|
||||
});
|
||||
});
|
||||
|
||||
describe('of <js-module> elements', function () {
|
||||
|
||||
Reference in New Issue
Block a user