Skip to content

Commit 1bbaa3d

Browse files
committed
Use TestUtilities.stripAnnotations in the InstallHelpers pnpm 11 test
1 parent 8f7b9ea commit 1bbaa3d

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

libraries/rush-lib/src/logic/test/InstallHelpers.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import { type IPackageJson, JsonFile } from '@rushstack/node-core-library';
55
import { StringBufferTerminalProvider, Terminal } from '@rushstack/terminal';
6+
import { TestUtilities } from '@rushstack/heft-config-file';
67

78
import { InstallHelpers } from '../installManager/InstallHelpers';
89
import { RushConfiguration } from '../../api/RushConfiguration';
@@ -110,12 +111,12 @@ describe(InstallHelpers.name, () => {
110111
expect(packageJson).not.toHaveProperty('pnpm');
111112

112113
// ...and the relocated settings are instead placed on the generated pnpm-workspace.yaml file.
113-
// (The arrays are spread to drop the ConfigurationFile annotation symbol they carry.)
114-
const workspaceFile: PnpmWorkspaceFile = pnpmSettings!.workspaceFile;
115-
expect([...(workspaceFile.ignoredOptionalDependencies ?? [])]).toEqual(['fsevents']);
116-
expect(workspaceFile.trustPolicy).toEqual('no-downgrade');
117-
expect([...(workspaceFile.trustPolicyExclude ?? [])]).toEqual(['chokidar@4.0.3']);
118-
expect(workspaceFile.trustPolicyIgnoreAfter).toEqual(1440);
114+
const workspaceFile: PnpmWorkspaceFile | undefined =
115+
TestUtilities.stripAnnotations(pnpmSettings)?.workspaceFile;
116+
expect(workspaceFile?.ignoredOptionalDependencies).toEqual(['fsevents']);
117+
expect(workspaceFile?.trustPolicy).toEqual('no-downgrade');
118+
expect(workspaceFile?.trustPolicyExclude).toEqual(['chokidar@4.0.3']);
119+
expect(workspaceFile?.trustPolicyIgnoreAfter).toEqual(1440);
119120
});
120121
});
121122
});

0 commit comments

Comments
 (0)