MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / createAndInstallTestTargets

Function createAndInstallTestTargets

tests/helpers/acceptance.js:135–165  ·  view source on GitHub ↗

* * @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)

Source from the content-addressed store, hash-verified

133 * @returns {Promise<{ result: string, path: string, cleanup: () => void }>} an object containing command result, path, and a cleanup function;
134 */
135async 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
167module.exports = {
168 createAndInstallTestTargets,

Callers 1

smoke-test-slow.jsFile · 0.85

Calls 1

applyCommandFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…