11import { create } from '../util' ;
22
3- describe ( '.realpathNative (...)' , ( ) => {
3+ describe ( '.realpath.native (...)' , ( ) => {
44 it ( 'works with async callback' , done => {
55 const vol = create ( { } ) ;
66 vol . mkdirSync ( '/a' ) ;
77 vol . mkdirSync ( '/c' ) ;
88 vol . writeFileSync ( '/c/index.js' , 'alert(123);' ) ;
99 vol . symlinkSync ( '/c' , '/a/b' ) ;
1010
11- vol . realpathNative ( '/a/b/index.js' , ( err , path ) => {
11+ vol . realpath . native ( '/a/b/index.js' , ( err , path ) => {
1212 expect ( err ) . toBe ( null ) ;
1313 expect ( path ) . toBe ( '/c/index.js' ) ;
1414 done ( ) ;
@@ -22,7 +22,7 @@ describe('.realpathNative(...)', () => {
2222 vol . writeFileSync ( '/c/index.js' , 'alert(123);' ) ;
2323 vol . symlinkSync ( '/c' , '/a/b' ) ;
2424
25- vol . realpathNative ( '/a/b/index.js' , 'utf8' , ( err , path ) => {
25+ vol . realpath . native ( '/a/b/index.js' , 'utf8' , ( err , path ) => {
2626 expect ( err ) . toBe ( null ) ;
2727 expect ( path ) . toBe ( '/c/index.js' ) ;
2828 done ( ) ;
@@ -36,7 +36,7 @@ describe('.realpathNative(...)', () => {
3636 vol . writeFileSync ( '/c/index.js' , 'alert(123);' ) ;
3737 vol . symlinkSync ( '/c' , '/a/b' ) ;
3838
39- vol . realpathNative ( '/a/b/index.js' , { encoding : 'utf8' } , ( err , path ) => {
39+ vol . realpath . native ( '/a/b/index.js' , { encoding : 'utf8' } , ( err , path ) => {
4040 expect ( err ) . toBe ( null ) ;
4141 expect ( path ) . toBe ( '/c/index.js' ) ;
4242 done ( ) ;
@@ -45,7 +45,7 @@ describe('.realpathNative(...)', () => {
4545
4646 it ( 'returns the root correctly' , done => {
4747 const vol = create ( { './a' : 'a' } ) ;
48- vol . realpathNative ( '/' , ( err , path ) => {
48+ vol . realpath . native ( '/' , ( err , path ) => {
4949 expect ( err ) . toBe ( null ) ;
5050 expect ( path ) . toBe ( '/' ) ;
5151 done ( ) ;
@@ -54,7 +54,7 @@ describe('.realpathNative(...)', () => {
5454
5555 it ( 'handles errors correctly' , done => {
5656 const vol = create ( { } ) ;
57- vol . realpathNative ( '/nonexistent' , ( err , path ) => {
57+ vol . realpath . native ( '/nonexistent' , ( err , path ) => {
5858 expect ( err ) . toBeTruthy ( ) ;
5959 expect ( err ?. code ) . toBe ( 'ENOENT' ) ;
6060 expect ( path ) . toBeUndefined ( ) ;
@@ -63,15 +63,15 @@ describe('.realpathNative(...)', () => {
6363 } ) ;
6464} ) ;
6565
66- describe ( '.realpathNativeSync (...)' , ( ) => {
66+ describe ( '.realpathSync.native (...)' , ( ) => {
6767 it ( 'works with symlinks' , ( ) => {
6868 const vol = create ( { } ) ;
6969 vol . mkdirSync ( '/a' ) ;
7070 vol . mkdirSync ( '/c' ) ;
7171 vol . writeFileSync ( '/c/index.js' , 'alert(123);' ) ;
7272 vol . symlinkSync ( '/c' , '/a/b' ) ;
7373
74- const path = vol . realpathNativeSync ( '/a/b/index.js' ) ;
74+ const path = vol . realpathSync . native ( '/a/b/index.js' ) ;
7575 expect ( path ) . toBe ( '/c/index.js' ) ;
7676 } ) ;
7777
@@ -82,7 +82,7 @@ describe('.realpathNativeSync(...)', () => {
8282 vol . writeFileSync ( '/c/index.js' , 'alert(123);' ) ;
8383 vol . symlinkSync ( '/c' , '/a/b' ) ;
8484
85- const path = vol . realpathNativeSync ( '/a/b/index.js' , 'utf8' ) ;
85+ const path = vol . realpathSync . native ( '/a/b/index.js' , 'utf8' ) ;
8686 expect ( path ) . toBe ( '/c/index.js' ) ;
8787 } ) ;
8888
@@ -93,35 +93,35 @@ describe('.realpathNativeSync(...)', () => {
9393 vol . writeFileSync ( '/c/index.js' , 'alert(123);' ) ;
9494 vol . symlinkSync ( '/c' , '/a/b' ) ;
9595
96- const path = vol . realpathNativeSync ( '/a/b/index.js' , { encoding : 'utf8' } ) ;
96+ const path = vol . realpathSync . native ( '/a/b/index.js' , { encoding : 'utf8' } ) ;
9797 expect ( path ) . toBe ( '/c/index.js' ) ;
9898 } ) ;
9999
100100 it ( 'returns the root correctly' , ( ) => {
101101 const vol = create ( { './a' : 'a' } ) ;
102- expect ( vol . realpathNativeSync ( '/' ) ) . toBe ( '/' ) ;
102+ expect ( vol . realpathSync . native ( '/' ) ) . toBe ( '/' ) ;
103103 } ) ;
104104
105105 it ( 'throws EACCES when the containing directory does not have sufficient permissions' , ( ) => {
106106 const vol = create ( { '/foo/bar' : 'bar' } ) ;
107107 vol . chmodSync ( '/foo' , 0o666 ) ; // rw
108108 expect ( ( ) => {
109- vol . realpathNativeSync ( '/foo/bar' ) ;
109+ vol . realpathSync . native ( '/foo/bar' ) ;
110110 } ) . toThrow ( / E A C C E S / ) ;
111111 } ) ;
112112
113113 it ( 'throws EACCES when an intermediate directory does not have sufficient permissions' , ( ) => {
114114 const vol = create ( { '/foo/bar' : 'bar' } ) ;
115115 vol . chmodSync ( '/' , 0o666 ) ; // rw
116116 expect ( ( ) => {
117- vol . realpathNativeSync ( '/foo/bar' ) ;
117+ vol . realpathSync . native ( '/foo/bar' ) ;
118118 } ) . toThrow ( / E A C C E S / ) ;
119119 } ) ;
120120
121121 it ( 'throws ENOENT for non-existent paths' , ( ) => {
122122 const vol = create ( { } ) ;
123123 expect ( ( ) => {
124- vol . realpathNativeSync ( '/nonexistent' ) ;
124+ vol . realpathSync . native ( '/nonexistent' ) ;
125125 } ) . toThrow ( / E N O E N T / ) ;
126126 } ) ;
127- } ) ;
127+ } ) ;
0 commit comments