mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
refactor: do not infer project root from script location (#1265)
* fix(Api): do not infer project root from script location * fix(builders): do not infer project root from script location * fix(target): do not infer project root from script location * test(e2e): cleanup and extend E2E tests - Renames the file with the only existing E2E test - Makes existing test use the API instance returned by `Api.createPlatform` - Adds another test that ensures we can still require the API from `platformProjectPath/cordova/Api.js` * fix(check_reqs): do not infer project root from script location
This commit is contained in:
committed by
GitHub
parent
70a1eff705
commit
1f0ea173b0
@@ -43,10 +43,8 @@ describe('ProjectBuilder', () => {
|
||||
expect(builder.root).toBe(rootDir);
|
||||
});
|
||||
|
||||
it('should set the project directory to three folders up', () => {
|
||||
ProjectBuilder.__set__('__dirname', 'projecttest/platforms/android/app');
|
||||
builder = new ProjectBuilder();
|
||||
expect(builder.root).toMatch(/projecttest$/);
|
||||
it('should throw if project directory is missing', () => {
|
||||
expect(() => new ProjectBuilder()).toThrowError(TypeError);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -224,7 +222,7 @@ describe('ProjectBuilder', () => {
|
||||
return builder.build({}).then(
|
||||
() => fail('Unexpectedly resolved'),
|
||||
error => {
|
||||
expect(checkReqsSpy.check_android_target).toHaveBeenCalled();
|
||||
expect(checkReqsSpy.check_android_target).toHaveBeenCalledWith(rootDir);
|
||||
expect(error).toBe(testError);
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user