From b1bdd55690165ea75e0217c9ebf78b6e41257aad Mon Sep 17 00:00:00 2001 From: Vladimir Kotikov Date: Wed, 3 Feb 2016 16:55:31 +0300 Subject: [PATCH] CB-10465 Pass correct options to prepare from compile --- cordova-lib/spec-cordova/emulate.spec.js | 6 +++--- cordova-lib/src/cordova/emulate.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cordova-lib/spec-cordova/emulate.spec.js b/cordova-lib/spec-cordova/emulate.spec.js index 4bf20b72e..5cea968b5 100644 --- a/cordova-lib/spec-cordova/emulate.spec.js +++ b/cordova-lib/spec-cordova/emulate.spec.js @@ -65,7 +65,7 @@ describe('emulate command', function() { describe('success', function() { it('should run inside a Cordova-based project with at least one added platform and call prepare and shell out to the emulate script', function(done) { cordova.raw.emulate(['android','ios']).then(function(err) { - expect(prepare_spy).toHaveBeenCalledWith(['android', 'ios']); + expect(prepare_spy).toHaveBeenCalledWith(jasmine.objectContaining({platforms: ['android', 'ios']})); expect(getPlatformApi).toHaveBeenCalledWith('android'); expect(getPlatformApi).toHaveBeenCalledWith('ios'); expect(platformApi.run).toHaveBeenCalled(); @@ -75,7 +75,7 @@ describe('emulate command', function() { }); it('should pass down options', function(done) { cordova.raw.emulate({platforms: ['ios'], options: {optionTastic: true }}).then(function(err) { - expect(prepare_spy).toHaveBeenCalledWith(['ios']); + expect(prepare_spy).toHaveBeenCalledWith(jasmine.objectContaining({platforms: ['ios']})); expect(getPlatformApi).toHaveBeenCalledWith('ios'); expect(platformApi.run).toHaveBeenCalledWith({ device: false, emulator: true, optionTastic: true }); }) @@ -89,7 +89,7 @@ describe('emulate command', function() { cordova.on('warn', warnSpy); cordova.raw.emulate({platforms:['ios'], options:['--optionTastic']}).then(function () { - expect(prepare_spy).toHaveBeenCalledWith(['ios']); + expect(prepare_spy).toHaveBeenCalledWith(jasmine.objectContaining({platforms: ['ios']})); expect(getPlatformApi).toHaveBeenCalledWith('ios'); expect(platformApi.run).toHaveBeenCalledWith(jasmine.objectContaining({emulator: true, argv: ['--optionTastic']})); }) diff --git a/cordova-lib/src/cordova/emulate.js b/cordova-lib/src/cordova/emulate.js index 67dedeb3d..62810fccc 100644 --- a/cordova-lib/src/cordova/emulate.js +++ b/cordova-lib/src/cordova/emulate.js @@ -33,7 +33,7 @@ module.exports = function emulate(options) { return hooksRunner.fire('before_emulate', options) .then(function() { // Run a prepare first! - return require('./cordova').raw.prepare(options.platforms); + return require('./cordova').raw.prepare(options); }).then(function() { // Deploy in parallel (output gets intermixed though...) return Q.all(options.platforms.map(function(platform) {