Skip to content

Commit 18a98ab

Browse files
fs.realpath.native tests
1 parent 2415634 commit 18a98ab

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

types/node/node-tests.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,32 @@ namespace fs_tests {
339339
b = fs.realpathSync('/path/to/folder', { encoding: 'buffer' });
340340
const v2 = fs.realpathSync('/path/to/folder', { encoding: s });
341341
typeof v2 === "string" ? s = v2 : b = v2;
342+
343+
// native
344+
fs.realpath.native('/path/to/folder', (err, resolvedPath) => s = resolvedPath);
345+
fs.realpath.native('/path/to/folder', undefined, (err, resolvedPath) => s = resolvedPath);
346+
fs.realpath.native('/path/to/folder', 'utf8', (err, resolvedPath) => s = resolvedPath);
347+
fs.realpath.native('/path/to/folder', 'buffer', (err, resolvedPath) => b = resolvedPath);
348+
fs.realpath.native('/path/to/folder', s, (err, resolvedPath) => typeof resolvedPath === 'string' ? s = resolvedPath : b = resolvedPath);
349+
fs.realpath.native('/path/to/folder', {}, (err, resolvedPath) => s = resolvedPath);
350+
fs.realpath.native('/path/to/folder', { encoding: undefined }, (err, resolvedPath) => s = resolvedPath);
351+
fs.realpath.native('/path/to/folder', { encoding: 'utf8' }, (err, resolvedPath) => s = resolvedPath);
352+
fs.realpath.native('/path/to/folder', { encoding: 'buffer' }, (err, resolvedPath) => b = resolvedPath);
353+
fs.realpath.native('/path/to/folder', { encoding: s }, (err, resolvedPath) => typeof resolvedPath === "string" ? s = resolvedPath : b = resolvedPath);
354+
355+
s = fs.realpathSync.native('/path/to/folder');
356+
s = fs.realpathSync.native('/path/to/folder', undefined);
357+
s = fs.realpathSync.native('/path/to/folder', 'utf8');
358+
b = fs.realpathSync.native('/path/to/folder', 'buffer');
359+
const v3 = fs.realpathSync.native('/path/to/folder', s);
360+
typeof v3 === "string" ? s = v3 : b = v3;
361+
362+
s = fs.realpathSync.native('/path/to/folder', {});
363+
s = fs.realpathSync.native('/path/to/folder', { encoding: undefined });
364+
s = fs.realpathSync.native('/path/to/folder', { encoding: 'utf8' });
365+
b = fs.realpathSync.native('/path/to/folder', { encoding: 'buffer' });
366+
const v4 = fs.realpathSync.native('/path/to/folder', { encoding: s });
367+
typeof v4 === "string" ? s = v4 : b = v4;
342368
}
343369

344370
{

0 commit comments

Comments
 (0)