diff --git a/packages/acceptance-tests/pkg-tests-specs/sources/commands/constraints.test.js b/packages/acceptance-tests/pkg-tests-specs/sources/commands/constraints.test.js index 9689af891067..559456b9fa8a 100644 --- a/packages/acceptance-tests/pkg-tests-specs/sources/commands/constraints.test.js +++ b/packages/acceptance-tests/pkg-tests-specs/sources/commands/constraints.test.js @@ -1,3 +1,4 @@ +const {npath} = require(`@yarnpkg/fslib`); const { fs: {writeFile}, } = require(`pkg-tests-core`); @@ -110,7 +111,8 @@ describe(`Commands`, () => { ({code, stdout, stderr} = error); } - stdout = stdout.replace(/[^( ]+[\\/](yarn\.config)/g, `/path/to/$1`); + // TODO: Use .replaceAll when we drop support for Node.js v14 + stdout = stdout.split(npath.join(npath.fromPortablePath(path), `yarn.config.js`)).join(`/path/to/yarn.config.js`); stdout = stdout.replace(/(Module|Object)\.(exports\.)/g, `$2`); expect({code, stdout, stderr}).toMatchSnapshot();