Skip to content

Commit

Permalink
Remove deprecation warning for platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
raphinesse committed Aug 28, 2018
1 parent bf7bfbe commit 9f1fbf4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
8 changes: 0 additions & 8 deletions spec/cordova/platforms/platforms.spec.js
Expand Up @@ -69,14 +69,6 @@ describe('getPlatformApi method', function () {
expect(util.requireNoCache.calls.argsFor(0)[0]).toEqual(path.join(CORDOVA_ROOT, 'platforms/windows/cordova/Api.js'));
});

it('should throw error if using deprecated platform', function () {
try {
platforms.getPlatformApi('android', path.join(CORDOVA_ROOT, 'platforms/android'));
} catch (error) {
expect(error.toString()).toContain('Using this version of Cordova with older version of cordova-android is deprecated. Upgrade to cordova-android@5.0.0 or newer.');
}
});

it('should cache PlatformApi instance for further calls', function () {
var platformApi = platforms.getPlatformApi('windows', PLATFORM_WITH_API);
expect(platformApi.fakeProperty).not.toBeDefined();
Expand Down
5 changes: 0 additions & 5 deletions spec/cordova/util.spec.js
Expand Up @@ -309,11 +309,6 @@ describe('util module', function () {
});

describe('getPlatformApiFunction', function () {
it('Test 027 : should throw error informing user to update platform', function () {
expect(function () { util.getPlatformApiFunction('some/path', 'android'); }).toThrowError(
/\( Using this version of Cordova with older version of cordova-android is deprecated\. Upgrade to cordova-android@5\.0\.0 or newer.\)/
);
});

it('Test 030 : successfully find platform Api', function () {
spyOn(events, 'emit').and.returnValue(true);
Expand Down
11 changes: 1 addition & 10 deletions src/cordova/util.js
Expand Up @@ -481,17 +481,8 @@ function getPlatformApiFunction (libDir, platform) {
} catch (err) {
// Emit the err, someone might care ...
events.emit('warn', 'Unable to load PlatformApi from platform. ' + err);
// Check if platform already compatible w/ PlatformApi and show deprecation warning if not
// checkPlatformApiCompatible(platform);
if (platforms[platform] && platforms[platform].apiCompatibleSince) {
events.emit('error', ' Using this version of Cordova with older version of cordova-' + platform +
' is deprecated. Upgrade to cordova-' + platform + '@' +
platforms[platform].apiCompatibleSince + ' or newer.');
} else if (!platforms[platform]) {
// Throw error because polyfill doesn't support non core platforms
if (!platforms[platform]) {
events.emit('error', 'The platform "' + platform + '" does not appear to be a valid cordova platform. It is missing API.js. ' + platform + ' not supported.');
} else {
events.emit('verbose', 'Platform not found or needs polyfill.');
}
}

Expand Down

0 comments on commit 9f1fbf4

Please sign in to comment.