({
name,
packageManager,
lernaInit,
initializeGit,
installDependencies,
e2eRoot,
forceDeterministicTerminalOutput,
}: FixtureCreateOptions)
| 64 | } |
| 65 | |
| 66 | static async create({ |
| 67 | name, |
| 68 | packageManager, |
| 69 | lernaInit, |
| 70 | initializeGit, |
| 71 | installDependencies, |
| 72 | e2eRoot, |
| 73 | forceDeterministicTerminalOutput, |
| 74 | }: FixtureCreateOptions): Promise<Fixture> { |
| 75 | const fixture = new Fixture( |
| 76 | e2eRoot, |
| 77 | // Make the underlying name include the package manager and be globally unique |
| 78 | uniq(`${name}-${packageManager}`), |
| 79 | packageManager, |
| 80 | forceDeterministicTerminalOutput || false |
| 81 | ); |
| 82 | |
| 83 | await fixture.createFixtureRoot(); |
| 84 | await fixture.createGitOrigin(); |
| 85 | |
| 86 | if (initializeGit) { |
| 87 | await fixture.gitCloneEmptyRemoteAsLernaWorkspace(); |
| 88 | } else { |
| 89 | await fixture.createEmptyDirectoryForWorkspace(); |
| 90 | } |
| 91 | |
| 92 | await fixture.setNpmRegistry(); |
| 93 | |
| 94 | if (lernaInit) { |
| 95 | // Use custom lerna init args if provided |
| 96 | await fixture.lernaInit(lernaInit === true ? "" : lernaInit.args?.join(" ")); |
| 97 | } |
| 98 | |
| 99 | await fixture.initializeNpmEnvironment(); |
| 100 | |
| 101 | if (installDependencies) { |
| 102 | await fixture.install(); |
| 103 | } |
| 104 | |
| 105 | return fixture; |
| 106 | } |
| 107 | |
| 108 | static fromExisting(e2eRoot: string, fixtureRootPath: string, forceDeterministicTerminalOutput = false) { |
| 109 | const fixtureName = fixtureRootPath.split(e2eRoot).pop(); |
no test coverage detected