Github user daserge commented on the pull request:

    https://github.com/apache/cordova-android/pull/260#issuecomment-185383888
  
    @vladimir-kotikov, addressed, thanks.
    @nikhilkh, I've tried to test private `getInstallTarget` with `rewire` but 
faced an issue caused by the fact that the test-time directory structure 
differs from the run-time one (so that `check-reqs` fails to load when rewire 
requires run -> emulator -> check_reqs):
    
    ```javascript
    var rewire = require("rewire");
    var run = rewire("../../bin/templates/cordova/lib/run");
    var getInstallTarget = run.__get__("getInstallTarget");
    
    describe("run", function () {
      describe("getInstallTarget", function() {
        var targetOpts = { target: "emu" };
        var deviceOpts = { device: true };
        var emulatorOpts = { emulator: true };
        var emptyOpts = {};
    
        it("should select correct target based on the run opts", function() {
            expect(getInstallTarget(targetOpts)).toBe("emu");
            expect(getInstallTarget(deviceOpts)).toBe("--device");
            expect(getInstallTarget(emulatorOpts)).toBe("--emulator");
            expect(getInstallTarget(emptyOpts)).toBeUndefined();
        });
      });
    });
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to