Bladeren bron

Fix linting errors

JC Brand 7 jaren geleden
bovenliggende
commit
f785c2df0a
2 gewijzigde bestanden met toevoegingen van 16 en 16 verwijderingen
  1. 4 4
      spec/disco.js
  2. 12 12
      spec/http-file-upload.js

+ 4 - 4
spec/disco.js

@@ -49,9 +49,9 @@
                      *  </query>
                      *  </iq>
                      */
-                    var stanza = _.filter(IQ_stanzas, function (iq) {
+                    var stanza = _.find(IQ_stanzas, function (iq) {
                         return iq.nodeTree.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]');
-                    })[0];
+                    });
                     var info_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)];
                     stanza = $iq({
                         'type': 'result',
@@ -128,9 +128,9 @@
                              * </query>
                              * </iq>
                              */
-                            var stanza = _.filter(IQ_stanzas, function (iq) {
+                            var stanza = _.find(IQ_stanzas, function (iq) {
                                 return iq.nodeTree.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#items"]');
-                            })[0];
+                            });
                             var items_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)];
                             stanza = $iq({
                                 'type': 'result',

+ 12 - 12
spec/http-file-upload.js

@@ -40,10 +40,10 @@
                          *  </query>
                          *  </iq>
                          */
-                        var stanza = _.filter(IQ_stanzas, function (iq) {
+                        var stanza = _.find(IQ_stanzas, function (iq) {
                             return iq.nodeTree.querySelector(
                                 'iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]');
-                        })[0];
+                        });
                         var info_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)];
 
                         stanza = $iq({
@@ -88,9 +88,9 @@
                          *  </query>
                          *  </iq>
                          */
-                    var stanza = _.filter(IQ_stanzas, function (iq) {
+                    var stanza = _.find(IQ_stanzas, function (iq) {
                         return iq.nodeTree.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#items"]');
-                    })[0];
+                    });
                     var items_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)];
                     stanza = $iq({
                         'type': 'result',
@@ -115,9 +115,9 @@
                             }, 300);
                         });
                     }).then(function () {
-                        var stanza = _.filter(IQ_stanzas, function (iq) {
+                        var stanza = _.find(IQ_stanzas, function (iq) {
                             return iq.nodeTree.querySelector('iq[to="upload.localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]');
-                        })[0];
+                        });
                         var IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)];
                         expect(stanza.toLocaleString()).toBe(
                             "<iq from='dummy@localhost/resource' to='upload.localhost' type='get' xmlns='jabber:client' id='"+IQ_id+"'>"+
@@ -323,10 +323,10 @@
                                         'iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]');
                                 }).length > 0;
                             }, 300).then(function () {
-                                var stanza = _.filter(IQ_stanzas, function (iq) {
+                                var stanza = _.find(IQ_stanzas, function (iq) {
                                     return iq.nodeTree.querySelector(
                                         'iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]');
-                                })[0];
+                                });
                                 var info_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)];
 
                                 stanza = $iq({
@@ -361,9 +361,9 @@
                                     }, 300);
                                 });
                             }).then(function () {
-                            var stanza = _.filter(IQ_stanzas, function (iq) {
+                            var stanza = _.find(IQ_stanzas, function (iq) {
                                 return iq.nodeTree.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#items"]');
-                            })[0];
+                            });
                             var items_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)];
                             stanza = $iq({
                                 'type': 'result',
@@ -388,9 +388,9 @@
                                     }, 300);
                                 });
                             }).then(function () {
-                                var stanza = _.filter(IQ_stanzas, function (iq) {
+                                var stanza = _.find(IQ_stanzas, function (iq) {
                                     return iq.nodeTree.querySelector('iq[to="upload.localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]');
-                                })[0];
+                                });
                                 var IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)];
                                 expect(stanza.toLocaleString()).toBe(
                                     "<iq from='dummy@localhost/resource' to='upload.localhost' type='get' xmlns='jabber:client' id='"+IQ_id+"'>"+