Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix use of stream.write(data, encoding) in tests
For several tests I used a shortcut to write an list-of-chunks to a stream: chunks.forEach(stream.write.bind(stream)); This is a quick way to make a function from a method. The problem is that `forEach` will pass the index of the array item as a second argument, and `write` has a second argument (buffer) `encoding`. In Node v15, the encoding is actually checked to see if it's valid -- and numbers are not valid buffer encodings: nodejs/node#33075 The fix is simply to be explicit about which arguments are passed, rather than relying on the shortcut. This is a little more verbose, but can still be put in line at least. Signed-off-by: Michael Bridgen <mikeb@squaremobius.net>
- Loading branch information