Quellcode durchsuchen

Real renaming + related updates.

Eugene Lazutkin vor 3 Jahren
Ursprung
Commit
1f5249a760

src/utils/ffromIterable.js → src/utils/fromIterable.js


+ 35 - 33
tests/test_FromIterable.js

@@ -5,11 +5,11 @@ const unit = require('heya-unit');
 const chain = require('../src/index');
 const {streamToArray, delay} = require('./helpers');
 
-const fromIterable = require('../src/utils/FromIterable');
+const fromIterable = require('../src/utils/fromIterable');
 
 unit.add(module, [
-  function test_FromIterable(t) {
-    const async = t.startAsync('test_FromIterable');
+  function test_fromIterable(t) {
+    const async = t.startAsync('test_fromIterable');
 
     const output = [],
       c = chain([fromIterable([1, 2, 3]), streamToArray(output)]);
@@ -19,8 +19,8 @@ unit.add(module, [
       async.done();
     });
   },
-  function test_FromIterableFun(t) {
-    const async = t.startAsync('test_FromIterableFun');
+  function test_fromIterableFun(t) {
+    const async = t.startAsync('test_fromIterableFun');
 
     const output = [],
       c = chain([fromIterable(() => 0), streamToArray(output)]);
@@ -30,8 +30,8 @@ unit.add(module, [
       async.done();
     });
   },
-  function test_FromIterableAsyncFun(t) {
-    const async = t.startAsync('test_FromIterableAsyncFun');
+  function test_fromIterableAsyncFun(t) {
+    const async = t.startAsync('test_fromIterableAsyncFun');
 
     const output = [],
       c = chain([fromIterable(delay(() => 0)), streamToArray(output)]);
@@ -41,12 +41,12 @@ unit.add(module, [
       async.done();
     });
   },
-  function test_FromIterableGen(t) {
-    const async = t.startAsync('test_FromIterableGen');
+  function test_fromIterableGen(t) {
+    const async = t.startAsync('test_fromIterableGen');
 
     const output = [],
       c = chain([
-        fromIterable(function*() {
+        fromIterable(function* () {
           yield 0;
           yield 1;
         }),
@@ -58,32 +58,34 @@ unit.add(module, [
       async.done();
     });
   },
-  // function test_FromIterableAsyncGen(t) {
-  //   const async = t.startAsync('test_FromIterableAsyncGen');
-
-  //   const output = [],
-  //     c = chain([
-  //       fromIterable(async function*() {
-  //         yield delay(() => 0)();
-  //         yield delay(() => 1)();
-  //       }),
-  //       streamToArray(output)
-  //     ]);
-
-  //   c.on('end', () => {
-  //     eval(t.TEST('t.unify(output, [0, 1])'));
-  //     async.done();
-  //   });
-  // },
-  function test_FromIterableNextable(t) {
-    const async = t.startAsync('test_FromIterableNextable');
+  function test_fromIterableAsyncGen(t) {
+    const async = t.startAsync('test_fromIterableAsyncGen');
 
     const output = [],
       c = chain([
-        fromIterable((function*() {
-          yield 0;
-          yield 1;
-        })()),
+        fromIterable(async function* () {
+          yield delay(() => 0)();
+          yield delay(() => 1)();
+        }),
+        streamToArray(output)
+      ]);
+
+    c.on('end', () => {
+      eval(t.TEST('t.unify(output, [0, 1])'));
+      async.done();
+    });
+  },
+  function test_fromIterableNextable(t) {
+    const async = t.startAsync('test_fromIterableNextable');
+
+    const output = [],
+      c = chain([
+        fromIterable(
+          (function* () {
+            yield 0;
+            yield 1;
+          })()
+        ),
         streamToArray(output)
       ]);
 

+ 1 - 1
tests/test_demo.js

@@ -5,7 +5,7 @@ const unit = require('heya-unit');
 const {Transform} = require('stream');
 
 const chain = require('../src/index');
-const fromIterable = require('../src/utils/FromIterable');
+const fromIterable = require('../src/utils/fromIterable');
 
 const getTotalFromDatabaseByKey = async x =>
 new Promise(resolve => {

+ 1 - 1
tests/test_fold.js

@@ -5,7 +5,7 @@ const unit = require('heya-unit');
 const {streamToArray, delay} = require('./helpers');
 const chain = require('../src/index');
 
-const fromIterable = require('../src/utils/FromIterable');
+const fromIterable = require('../src/utils/fromIterable');
 const fold = require('../src/utils/fold');
 const scan = require('../src/utils/scan');
 const reduce = require('../src/utils/reduce');

+ 1 - 1
tests/test_fun.js

@@ -5,7 +5,7 @@ const unit = require('heya-unit');
 const {streamToArray, delay} = require('./helpers');
 const chain = require('../src/index');
 
-const fromIterable = require('../src/utils/FromIterable');
+const fromIterable = require('../src/utils/fromIterable');
 const fun = require('../src/fun');
 
 const {none, finalValue, many} = chain;

+ 1 - 1
tests/test_gen.js

@@ -4,7 +4,7 @@ const unit = require('heya-unit');
 
 const {streamToArray, delay} = require('./helpers');
 const chain = require('../src/index');
-const fromIterable = require('../src/utils/FromIterable');
+const fromIterable = require('../src/utils/fromIterable');
 
 const {none, finalValue, many, gen} = chain;
 

+ 1 - 1
tests/test_readWrite.js

@@ -4,7 +4,7 @@ const unit = require('heya-unit');
 
 const {streamToArray} = require('./helpers');
 const chain = require('../src/index');
-const fromIterable = require('../src/utils/FromIterable');
+const fromIterable = require('../src/utils/fromIterable');
 
 unit.add(module, [
   function test_readWriteReadable(t) {

+ 1 - 1
tests/test_simple.js

@@ -5,7 +5,7 @@ const unit = require('heya-unit');
 const {Transform} = require('stream');
 const {streamToArray, delay} = require('./helpers');
 const chain = require('../src/index');
-const fromIterable = require('../src/utils/FromIterable');
+const fromIterable = require('../src/utils/fromIterable');
 
 unit.add(module, [
   function test_simpleGeneric(t) {

+ 1 - 1
tests/test_skip.js

@@ -5,7 +5,7 @@ const unit = require('heya-unit');
 const {streamToArray, delay} = require('./helpers');
 const chain = require('../src/index');
 
-const fromIterable = require('../src/utils/FromIterable');
+const fromIterable = require('../src/utils/fromIterable');
 const skip = require('../src/utils/skip');
 const skipWhile = require('../src/utils/skipWhile');
 

+ 1 - 1
tests/test_take.js

@@ -5,7 +5,7 @@ const unit = require('heya-unit');
 const {streamToArray, delay} = require('./helpers');
 const chain = require('../src/index');
 
-const fromIterable = require('../src/utils/FromIterable');
+const fromIterable = require('../src/utils/fromIterable');
 const take = require('../src/utils/take');
 const takeWhile = require('../src/utils/takeWhile');
 const takeWithSkip = require('../src/utils/takeWithSkip');

+ 1 - 1
tests/test_transducers.js

@@ -4,7 +4,7 @@ const unit = require('heya-unit');
 
 const {streamToArray} = require('./helpers');
 const chain = require('../src/index');
-const fromIterable = require('../src/utils/FromIterable');
+const fromIterable = require('../src/utils/fromIterable');
 
 const {gen} = chain;
 

+ 1 - 1
tests/tests.js

@@ -2,7 +2,7 @@
 
 const unit = require('heya-unit');
 
-require('./test_FromIterable');
+require('./test_fromIterable');
 
 require('./test_simple');
 require('./test_readWrite');