( fixture: Fixture, releasePlan: ReleasePlan, config?: Config, snapshot?: string | undefined, setupFunc?: (tempDir: string) => Promise<unknown> )
| 79 | } |
| 80 | |
| 81 | async function testSetup( |
| 82 | fixture: Fixture, |
| 83 | releasePlan: ReleasePlan, |
| 84 | config?: Config, |
| 85 | snapshot?: string | undefined, |
| 86 | setupFunc?: (tempDir: string) => Promise<unknown> |
| 87 | ) { |
| 88 | if (!config) { |
| 89 | config = { |
| 90 | changelog: false, |
| 91 | commit: false, |
| 92 | fixed: [], |
| 93 | linked: [], |
| 94 | access: "restricted", |
| 95 | changedFilePatterns: ["**"], |
| 96 | baseBranch: "main", |
| 97 | updateInternalDependencies: "patch", |
| 98 | ignore: [], |
| 99 | prettier: true, |
| 100 | privatePackages: { version: true, tag: false }, |
| 101 | snapshot: { |
| 102 | useCalculatedVersion: false, |
| 103 | prereleaseTemplate: null, |
| 104 | }, |
| 105 | ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: { |
| 106 | onlyUpdatePeerDependentsWhenOutOfRange: false, |
| 107 | updateInternalDependents: "out-of-range", |
| 108 | }, |
| 109 | }; |
| 110 | } |
| 111 | let tempDir = await testdir(fixture); |
| 112 | |
| 113 | if (setupFunc) { |
| 114 | await setupFunc(tempDir); |
| 115 | } |
| 116 | |
| 117 | if (config.commit) { |
| 118 | await spawn("git", ["init"], { cwd: tempDir }); |
| 119 | await git.add(".", tempDir); |
| 120 | await git.commit("first commit", tempDir); |
| 121 | } |
| 122 | |
| 123 | return { |
| 124 | changedFiles: await applyReleasePlan( |
| 125 | releasePlan, |
| 126 | await getPackages(tempDir), |
| 127 | config, |
| 128 | snapshot |
| 129 | ), |
| 130 | tempDir, |
| 131 | }; |
| 132 | } |
| 133 | |
| 134 | describe("apply release plan", () => { |
| 135 | describe("versioning", () => { |
no test coverage detected