diff --git a/test/parallel/test-fs-fsync.js b/test/parallel/test-fs-fsync.js index 89d104c00246bc..1fae0a542d844e 100644 --- a/test/parallel/test-fs-fsync.js +++ b/test/parallel/test-fs-fsync.js @@ -1,32 +1,22 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); -var path = require('path'); -var fs = require('fs'); -var successes = 0; +const path = require('path'); +const fs = require('fs'); var file = path.join(common.fixturesDir, 'a.js'); -fs.open(file, 'a', 0o777, function(err, fd) { +fs.open(file, 'a', 0o777, common.mustCall(function(err, fd) { if (err) throw err; fs.fdatasyncSync(fd); - successes++; fs.fsyncSync(fd); - successes++; - fs.fdatasync(fd, function(err) { + fs.fdatasync(fd, common.mustCall(function(err) { if (err) throw err; - successes++; - fs.fsync(fd, function(err) { + fs.fsync(fd, common.mustCall(function(err) { if (err) throw err; - successes++; - }); - }); -}); - -process.on('exit', function() { - assert.equal(4, successes); -}); + })); + })); +}));