* * @param {string} projectName * @param {string} options.command defaults to new * @returns {Promise<{ result: string, path: string, cleanup: () => void }>} an object containing command result, path, and a cleanup function;
(projectName, options)
| 133 | * @returns {Promise<{ result: string, path: string, cleanup: () => void }>} an object containing command result, path, and a cleanup function; |
| 134 | */ |
| 135 | async function createAndInstallTestTargets(projectName, options) { |
| 136 | let outputDir = await tmp.dir({ unsafeCleanup: true }); |
| 137 | |
| 138 | let command = options?.command ?? 'new'; |
| 139 | |
| 140 | let result = await applyCommand(command, projectName, '--skip-npm', `--directory=${outputDir.path}`); |
| 141 | |
| 142 | await execa('pnpm', ['install', '--prefer-offline'], { |
| 143 | preferLocal: true, |
| 144 | cwd: outputDir.path, |
| 145 | }); |
| 146 | |
| 147 | for (let pkg of [ |
| 148 | '.', |
| 149 | 'packages/blueprint-model', |
| 150 | 'packages/blueprint-blueprint', |
| 151 | 'packages/app-blueprint', |
| 152 | 'packages/addon-blueprint', |
| 153 | ]) { |
| 154 | await execa('pnpm', ['link', path.join(__dirname, `../../${pkg}`)], { |
| 155 | preferLocal: true, |
| 156 | cwd: outputDir.path, |
| 157 | }); |
| 158 | } |
| 159 | |
| 160 | return { |
| 161 | result, |
| 162 | cleanup: outputDir.cleanup, |
| 163 | path: outputDir.path, |
| 164 | }; |
| 165 | } |
| 166 | |
| 167 | module.exports = { |
| 168 | createAndInstallTestTargets, |
no test coverage detected
searching dependent graphs…