MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / setupFixture

Function setupFixture

scripts/bump-version.test.ts:21–44  ·  view source on GitHub ↗
({
  workspaces,
  packages,
}: {
  workspaces?: string[];
  packages: Record<string, Record<string, unknown>>;
})

Source from the content-addressed store, hash-verified

19}
20
21function setupFixture({
22 workspaces,
23 packages,
24}: {
25 workspaces?: string[];
26 packages: Record<string, Record<string, unknown>>;
27}): string {
28 const rootDir = createTempDir();
29
30 const workspaceEntries: string[] = [];
31 for (const [dirName, pkgContent] of Object.entries(packages)) {
32 writePackageJson(path.join(rootDir, dirName), pkgContent);
33 workspaceEntries.push(dirName);
34 }
35
36 writePackageJson(rootDir, {
37 private: true,
38 name: 'test-monorepo',
39 version: '0.0.0',
40 workspaces: workspaces || workspaceEntries,
41 });
42
43 return rootDir;
44}
45
46describe('bump-version', () => {
47 const tempDirs: string[] = [];

Callers 1

Calls 4

writePackageJsonFunction · 0.85
pushMethod · 0.80
createTempDirFunction · 0.70
entriesMethod · 0.65

Tested by

no test coverage detected