coverage: pass cwd to path.resolve() in setup
During coverage setup, path.resolve() is called. path.resolve() can potentially call process.cwd(), which hasn't been bootstrapped yet. This commit passes the current working directory directly so that path.resolve() doesn't attempt to compute it. PR-URL: https://github.com/nodejs/node/pull/25289 Fixes: https://github.com/nodejs/node/issues/25287 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
d32f769d75
commit
a779ee4fad
@ -76,9 +76,10 @@ function setup() {
|
||||
}));
|
||||
|
||||
try {
|
||||
const { cwd } = internalBinding('process_methods');
|
||||
const { resolve } = require('path');
|
||||
coverageDirectory = process.env.NODE_V8_COVERAGE =
|
||||
resolve(process.env.NODE_V8_COVERAGE);
|
||||
resolve(cwd(), process.env.NODE_V8_COVERAGE);
|
||||
} catch (err) {
|
||||
process._rawDebug(err.toString());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user