it('each2', function () {
   var callCount = 0;
   _.each2([1, 2, 3], function (n, i) {
     expect(i).to.be(callCount);
     ++callCount;
     expect(n).to.be(callCount);
   });
 });
Example #2
0
                    return __.then (x, function (x) {

                        if (_.isStrictlyObject (x)) {

                            var result = _.coerceToEmpty (x),
                                tasks  = new TaskPool (cfg)

                            _.each2 (x, function (v, k) {
                                            tasks.run (fn.$ (v, k, x)).then (
                                                                        function (vk) {
                                                                            if (vk) {
                                                                                result[vk[1]] = vk[0] } }) })
                            return tasks.all.then (_.constant (result)) }

                        else {
                            return __(fn, x, undefined, x).then (function (vk) { return vk[0] }) } }) }
Example #3
0
 _.each (_.tests, (tests, suiteName) => {
     _.each2 (tests, (fn, name) => {
         emit ({ suiteName: suiteName, name: name, fn: fn.$ (cfg.context) }) }) }))