Skip to content

Commit

Permalink
Use older semver style for old Node.js 0.10 npm versions (#182)
Browse files Browse the repository at this point in the history
* Use older semver style for old Node.js 0.10 npm versions
* Fix test for changes Node.js 10 behavior
  • Loading branch information
dougwilson authored and ashtuchkin committed May 5, 2018
1 parent c679ab2 commit be3c9e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -41,6 +41,6 @@
"iconv": "*"
},
"dependencies": {
"safer-buffer": "^2.1.0"
"safer-buffer": ">= 2.1.2 < 3"
}
}
7 changes: 4 additions & 3 deletions test/streams-test.js
Expand Up @@ -214,13 +214,14 @@ describe("Streaming mode", function() {
input: [[0x3D], [0xD8, 0x3B], [0xDE]], // U+1F63B, 😻, SMILING CAT FACE WITH HEART-SHAPED EYES
outputType: false, // Don't concat
checkOutput: function(res) {
if (semver.lt(process.version, "v6.2.1")) {
assert.deepEqual(res, ["\uD83D\uDE3B"]); // We should have only 1 chunk.
} else {
if (semver.satisfies(process.version, '>= 6.2.1 < 10.0.0')) {
// After a string_decoder rewrite in https://github.com/nodejs/node/pull/6777, which
// was merged in Node v6.2.1, we don't merge chunks anymore.
// Not really correct, but it seems we cannot do anything with it.
// Though it has been fixed again in Node v10.0.0
assert.deepEqual(res, ["\uD83D", "\uDE3B"]);
} else {
assert.deepEqual(res, ["\uD83D\uDE3B"]); // We should have only 1 chunk.
}
},
}));
Expand Down

0 comments on commit be3c9e5

Please sign in to comment.