Skip to content
Permalink
Browse files
Fix some unhandled promises
  • Loading branch information
raphinesse committed Sep 29, 2018
1 parent 4701dcb commit ddac33d5ef3eb18c811ce9fb367626f73713996f
Showing 2 changed files with 3 additions and 4 deletions.
@@ -486,7 +486,7 @@ describe('pkgJson', function () {
expect(installedPlatforms()).toEqual([]);

// Remove for testing purposes so platform is not pre-installed.
cordova.platform('rm', PLATFORM, {save: true}).then(function () {
return cordova.platform('rm', PLATFORM, {save: true}).then(function () {
return cordova.platform('add', PLATFORM, {save: true});
}).then(function () {
// pkg.json has new platform.
@@ -35,9 +35,8 @@ describe('cordova/platform/check', function () {
spyOn(platform, 'add').and.returnValue(Promise.resolve());
});

it('If no results, platforms cannot be updated', function () {
platform.add.and.returnValue(Promise.reject());
cordova_util.listPlatforms.and.callThrough();
it('If no platforms, platforms cannot be updated', function () {
cordova_util.listPlatforms.and.returnValue([]);
return platform_check(hooks_mock, projectRoot).then(function () {
expect(events.emit).toHaveBeenCalledWith('results', jasmine.stringMatching(/No platforms can be updated/));
expect(superspawn.spawn).toHaveBeenCalledWith('npm', ['--loglevel=silent', '--json', 'outdated', 'cordova-lib'], jasmine.any(Object));

0 comments on commit ddac33d

Please sign in to comment.