diff --git a/test/parallel/test-fs-write-string-coerce.js b/test/parallel/test-fs-write-string-coerce.js index 4581c319277a78..b9ac82aec026c5 100644 --- a/test/parallel/test-fs-write-string-coerce.js +++ b/test/parallel/test-fs-write-string-coerce.js @@ -17,12 +17,12 @@ fs.open(fn, 'w', 0o644, common.mustCall(function(err, fd) { fs.write(fd, data, 0, 'utf8', common.mustCall(function(err, written) { console.log('write done'); assert.ifError(err); - assert.strictEqual(Buffer.byteLength(expected), written); + assert.strictEqual(written, Buffer.byteLength(expected)); fs.closeSync(fd); const found = fs.readFileSync(fn, 'utf8'); console.log(`expected: "${expected}"`); console.log(`found: "${found}"`); fs.unlinkSync(fn); - assert.strictEqual(expected, found); + assert.strictEqual(found, expected); })); }));