chore(misc): fix yarn berry tests (#18694)
This commit is contained in:
parent
e2ff519db2
commit
f8893b6a8e
@ -15,6 +15,7 @@ import {
|
||||
} from '@nx/e2e/utils';
|
||||
import { readFileSync } from 'fs';
|
||||
import { existsSync, mkdirSync, rmSync } from 'fs-extra';
|
||||
import { getPackageManagerVersion } from '@nx/devkit';
|
||||
|
||||
describe('create-nx-workspace', () => {
|
||||
const packageManager = getSelectedPackageManager() || 'pnpm';
|
||||
@ -450,11 +451,13 @@ describe('create-nx-workspace parent folder', () => {
|
||||
describe('create-nx-workspace yarn berry', () => {
|
||||
const tmpDir = `${e2eCwd}/${uniq('yarn-berry')}`;
|
||||
let wsName: string;
|
||||
let yarnVersion: string;
|
||||
|
||||
beforeAll(() => {
|
||||
mkdirSync(tmpDir, { recursive: true });
|
||||
runCommand('corepack prepare yarn@stable --activate', { cwd: tmpDir });
|
||||
runCommand('yarn set version stable', { cwd: tmpDir });
|
||||
yarnVersion = runCommand('yarn --version', { cwd: tmpDir }).trim();
|
||||
// previous command creates a package.json file which we don't want
|
||||
rmSync(`${tmpDir}/package.json`);
|
||||
process.env.YARN_ENABLE_IMMUTABLE_INSTALLS = 'false';
|
||||
@ -477,7 +480,7 @@ describe('create-nx-workspace yarn berry', () => {
|
||||
).toMatchInlineSnapshot(`
|
||||
"nodeLinker: node-modules
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.6.1.cjs
|
||||
yarnPath: .yarn/releases/yarn-${yarnVersion}.cjs
|
||||
"
|
||||
`);
|
||||
});
|
||||
@ -497,7 +500,7 @@ describe('create-nx-workspace yarn berry', () => {
|
||||
).toMatchInlineSnapshot(`
|
||||
"nodeLinker: node-modules
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.6.1.cjs
|
||||
yarnPath: .yarn/releases/yarn-${yarnVersion}.cjs
|
||||
"
|
||||
`);
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user