Skip to content

Commit

Permalink
Build: Fix node 10 test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Nov 19, 2018
1 parent adc75ed commit 6aef383
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/file-operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,9 @@ describe('getOwnerDiff', function() {
});

describe('closeFd', function() {
// This is just a very large number since node broke our tests by disallowing -1
// We're also doing some hacky version matching because node 0.12 accepts 10000 on Windows (and fails the test)
var invalidFd = process.version[1] === '0' ? -1 : 10000;

it('calls the callback with propagated error if fd is not a number', function(done) {
var propagatedError = new Error();
Expand All @@ -719,7 +722,7 @@ describe('closeFd', function() {
});

it('calls the callback with close error if no error to propagate', function(done) {
closeFd(null, -1, function(err) {
closeFd(null, invalidFd, function(err) {
expect(err).toExist();

done();
Expand All @@ -729,7 +732,7 @@ describe('closeFd', function() {
it('calls the callback with propagated error if close errors', function(done) {
var propagatedError = new Error();

closeFd(propagatedError, -1, function(err) {
closeFd(propagatedError, invalidFd, function(err) {
expect(err).toEqual(propagatedError);

done();
Expand Down

0 comments on commit 6aef383

Please sign in to comment.