Ver Fonte

Added a guard.

Eugene Lazutkin há 3 anos atrás
pai
commit
9a02c1c4f9
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      tests/helpers.mjs

+ 1 - 1
tests/helpers.mjs

@@ -13,7 +13,7 @@ export const streamToArray = array =>
 
 export const readString = (string, quant) => new Readable({
   read() {
-    if (isNaN(quant)) {
+    if (isNaN(quant) || quant < 1) {
       this.push(string);
     } else if (string instanceof Buffer) {
       for (let i = 0; i < string.length; i += quant) {