From c226cb7569a7d43742899ebb76287d3bd10c8e70 Mon Sep 17 00:00:00 2001 From: Lam Wei Li Date: Fri, 14 Jan 2022 21:13:13 +0800 Subject: [PATCH] test: update fakeFS.read as graceful-fs uses it `fs-extra@10.0.0` broke it as it removed the check for `fs.realpath.native`. ```diff +L064 exports.realpath.native = u(fs.realpath.native) -L126 -L127 // fs.realpath.native only available in Node v9.2+ -L128 if (typeof fs.realpath.native === 'function') { -L129 exports.realpath.native = u(fs.realpath.native) -L130 } ``` _(https://github.com/jprichardson/node-fs-extra/pull/887/files)_ When `fs.realpath` is an empty function, fs.realpath.native is `undefined`. https://github.com/log4js-node/log4js-node/blob/25c17ad9802082d7a0fcf9c228cc5b99661e3ed9/test/tap/configuration-test.js#L17 --- test/tap/configuration-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/configuration-test.js b/test/tap/configuration-test.js index 0b468ba..f72a4a4 100644 --- a/test/tap/configuration-test.js +++ b/test/tap/configuration-test.js @@ -14,7 +14,7 @@ test("log4js configure", batch => { fileRead = 0; fakeFS = { - realpath: () => {}, // fs-extra looks for this + realpath: realFS.realpath, // fs-extra looks for this ReadStream: realFS.ReadStream, // need to define these, because graceful-fs uses them WriteStream: realFS.WriteStream, read: realFS.read,