Skip to content

Commit

Permalink
all platforms will now pass successfully I hope...
Browse files Browse the repository at this point in the history
  • Loading branch information
breautek committed Apr 13, 2020
1 parent 59058be commit e9f6c5e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions spec/unit/check_reqs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ describe('check_reqs', function () {
delete process.env.PATH;
});

const expectedAndroidSdkPath = path.sep + 'android' + path.sep + 'sdk';
const expectedAndroidRootSdkPath = path.sep + 'android' + path.sep + 'sdk' + path.sep + 'root';

it('should error if neither ANDROID_SDK_ROOT or ANDROID_HOME is defined', () => {
spyOn(fs, 'existsSync').and.returnValue(true);
return check_reqs.check_android().catch((error) => {
Expand All @@ -182,15 +185,15 @@ describe('check_reqs', function () {
spyOn(fs, 'existsSync').and.returnValue(true);
process.env.ANDROID_SDK_ROOT = '/android/sdk';
return check_reqs.check_android().then(() => {
expect(process.env.ANDROID_SDK_ROOT).toContain('/android/sdk');
expect(process.env.ANDROID_SDK_ROOT).toContain(expectedAndroidSdkPath);
});
});

it('should use ANDROID_HOME if defined and ANDROID_SDK_ROOT is not defined', () => {
spyOn(fs, 'existsSync').and.returnValue(true);
process.env.ANDROID_HOME = '/android/sdk';
return check_reqs.check_android().then(() => {
expect(process.env.ANDROID_SDK_ROOT).toContain('/android/sdk');
expect(process.env.ANDROID_SDK_ROOT).toContain(expectedAndroidSdkPath);
});
});

Expand All @@ -199,7 +202,7 @@ describe('check_reqs', function () {
process.env.ANDROID_SDK_ROOT = '/android/sdk/root';
process.env.ANDROID_HOME = '/android/sdk';
return check_reqs.check_android().then(() => {
expect(process.env.ANDROID_SDK_ROOT).toContain('/android/sdk/root');
expect(process.env.ANDROID_SDK_ROOT).toContain(expectedAndroidRootSdkPath);
});
});

Expand Down

0 comments on commit e9f6c5e

Please sign in to comment.