Skip to content

Commit

Permalink
fix node 0.10 for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed May 4, 2018
1 parent f81db33 commit 6930368
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ var concat = require('concat-stream')
var net = require('net')
var duplexify = require('./')

var HELLO_WORLD = (Buffer.from && Buffer.from !== Uint8Array.from)
? Buffer.from('hello world')
: new Buffer('hello world')

tape('passthrough', function(t) {
t.plan(2)

Expand Down Expand Up @@ -275,7 +279,7 @@ tape('works with node native streams (net)', function(t) {
var dup = duplexify(socket, socket)

dup.once('data', function(chunk) {
t.same(chunk, Buffer('hello world'))
t.same(chunk, HELLO_WORLD)
server.close()
socket.end()
t.end()
Expand All @@ -286,6 +290,6 @@ tape('works with node native streams (net)', function(t) {
var socket = net.connect(server.address().port)
var dup = duplexify(socket, socket)

dup.write(Buffer('hello world'))
dup.write(HELLO_WORLD)
})
})

3 comments on commit 6930368

@jacobq

This comment was marked as off-topic.

@mafintosh
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this was actually 0.10. We broke 0.10 while trying to support 10. Still needed to support 0.10 to avoid semver major

@jacobq

This comment was marked as off-topic.

Please sign in to comment.