[ 
https://issues.apache.org/jira/browse/CB-8096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14229479#comment-14229479
 ] 

ASF GitHub Bot commented on CB-8096:
------------------------------------

Github user sgrebnov commented on a diff in the pull request:

    
https://github.com/apache/cordova-plugin-device-motion/pull/22#discussion_r21073185
  
    --- Diff: tests/tests.js ---
    @@ -20,6 +20,9 @@
     */
     
     exports.defineAutoTests = function () {
    +    var isWindows = (cordova.platformId === "windows") || 
(cordova.platformId === "windows8"),
    +        isAccelExist = isWindows ? 
Windows.Devices.Sensors.Accelerometer.getDefault() !== null : false;
    --- End diff --
    
    1. To generic variable name, rename isAccelExist -> isAccelExistWidows 
since this check applies to Windows only
    2. I think this breaks check on non-Widnows devices since isAccelExist is 
always FALSE on non-Windows platforms
    
    You should do
    if (isWindows && !isAccelExistWindows) {
        pending
    }


> Under Windows device  motion auto tests failed if accelerometer doesn't exist 
> on this device
> --------------------------------------------------------------------------------------------
>
>                 Key: CB-8096
>                 URL: https://issues.apache.org/jira/browse/CB-8096
>             Project: Apache Cordova
>          Issue Type: Test
>          Components: mobile-spec, Plugin Device Motion
>            Reporter: Maria Bukharina
>
> Proposed to pend that tests if  accelerometer doesn't exist on the device



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to