[
https://issues.apache.org/jira/browse/CB-8385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14301234#comment-14301234
]
ASF GitHub Bot commented on CB-8385:
------------------------------------
GitHub user sgrebnov opened a pull request:
https://github.com/apache/cordova-plugin-test-framework/pull/10
CB-8385 Ensure plugin-test-framework trigger tests only once
https://issues.apache.org/jira/browse/CB-8385
Simplified medic config loading logic by making it synch => prevent calling
callback function several times
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/MSOpenTech/cordova-plugin-test-framework
CB-8385
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-plugin-test-framework/pull/10.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #10
----
commit bb277ac5d5ac675ecc2ff91f6414a17ae0f45442
Author: sgrebnov <[email protected]>
Date: 2015-01-30T14:18:06Z
CB-8385 Ensure plugin-test-framework trigger tests only once
----
> Ensure plugin-test-framework runs tests only once
> -------------------------------------------------
>
> Key: CB-8385
> URL: https://issues.apache.org/jira/browse/CB-8385
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin TestFramework
> Reporter: Sergey Grebnov
> Assignee: Sergey Grebnov
> Labels: cordova-plugin-test-framework
>
> I see this on Windows. This is happening when test-framework checks whether
> Medic config exists and calls callback twice when there is no config
> available (default case when you use test framework locally):
> 1. Inside onload
> 2. Inside exception catch block
> {code}
> exports.load = function (callback) {
> var xhr = new XMLHttpRequest();
> xhr.open("GET", "../medic.json", true);
> xhr.onload = function() {
> if (xhr.readyState == 4 && xhr.status == 200) {
> var cfg = JSON.parse(xhr.responseText);
> exports.logurl = cfg.logurl;
> exports.enabled = true;
> console.log('Loaded Medic Config: logurl=' + exports.logurl);
> }
> callback();
> }
> xhr.onerror = function() {
> callback();
> }
> try {
> xhr.send(null);
> }
> catch(ex) {
> // some platforms throw on a file not found
> console.log('Did not find medic config file');
> setTimeout(function(){
> callback();
> },0);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]