0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/test/parallel/test-fs-realpath-native.js
Ruben Bridgewater c3eb3efa31
fs: fix functions executed in wrong context
The callback should run in the global scope and not in the FSReqWrap
context.

PR-URL: https://github.com/nodejs/node/pull/18668
Refs: https://github.com/nodejs/node/pull/12562
Refs: https://github.com/nodejs/node/pull/12976
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2018-02-26 23:18:21 +00:00

14 lines
399 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const fs = require('fs');
if (!common.isOSX) common.skip('MacOS-only test.');
assert.strictEqual(fs.realpathSync.native('/users'), '/Users');
fs.realpath.native('/users', common.mustCall(function(err, res) {
assert.ifError(err);
assert.strictEqual(res, '/Users');
assert.strictEqual(this, undefined);
}));