Update readConfig to use fs.access so the async path is fully async.

This commit is contained in:
David Anson 2021-08-12 20:43:18 -07:00
parent 211f09afbc
commit 709e314836
5 changed files with 108 additions and 28 deletions

View file

@ -1155,8 +1155,9 @@ test.cb("configCustomFileSystem", (t) => {
"MD002": true
};
const fsApi = {
"accessSync": (p) => {
t.is(p, extended);
"access": (p, m, cb) => {
t.is(path.resolve(p), extended);
return (cb || m)();
},
"readFile": (p, o, cb) => {
switch (p) {
@ -1455,7 +1456,7 @@ test("configCustomFileSystemSync", (t) => {
};
const fsApi = {
"accessSync": (p) => {
t.is(p, extended);
t.is(path.resolve(p), extended);
},
"readFileSync": (p) => {
switch (p) {
@ -1520,8 +1521,9 @@ test.cb("configCustomFileSystemPromise", (t) => {
"MD002": true
};
const fsApi = {
"accessSync": (p) => {
t.is(p, extended);
"access": (p, m, cb) => {
t.is(path.resolve(p), extended);
return (cb || m)();
},
"readFile": (p, o, cb) => {
switch (p) {