( assetName: string, useNpmPackages = false, skipInstall = false, )
| 45 | * to use the local NPM registry. |
| 46 | * */ |
| 47 | export async function createProjectFromAsset( |
| 48 | assetName: string, |
| 49 | useNpmPackages = false, |
| 50 | skipInstall = false, |
| 51 | ): Promise<() => Promise<void>> { |
| 52 | const dir = await copyAssets(assetName); |
| 53 | process.chdir(dir); |
| 54 | |
| 55 | await setRegistry(!useNpmPackages /** useTestRegistry */); |
| 56 | |
| 57 | if (!useNpmPackages) { |
| 58 | await useBuiltPackagesVersions(); |
| 59 | } |
| 60 | if (!skipInstall) { |
| 61 | await installWorkspacePackages(); |
| 62 | } |
| 63 | |
| 64 | return () => setRegistry(true /** useTestRegistry */); |
| 65 | } |
| 66 | |
| 67 | export function getTestAssetsDir(): string { |
| 68 | return join(getGlobalVariable('projects-root'), 'assets'); |
no test coverage detected