()
| 97 | } |
| 98 | |
| 99 | export async function createMultiChainTestProject(): Promise<{multichainManifestPath: string; fullPaths: string[]}> { |
| 100 | const tmpdir = await fs.promises.mkdtemp(`${os.tmpdir()}${path.sep}`); |
| 101 | const projectDir = path.join(tmpdir, multiProjectSpecV1_0_0.name); |
| 102 | |
| 103 | const exampleProject = await getExampleProject('multi', 'multi'); |
| 104 | |
| 105 | await cloneProjectTemplate(tmpdir, multiProjectSpecV1_0_0.name, exampleProject); |
| 106 | |
| 107 | await installAndBuild(projectDir); |
| 108 | |
| 109 | const project = getProjectRootAndManifest(projectDir); |
| 110 | const fullPaths = project.manifests.map((manifest) => path.join(project.root, manifest)); |
| 111 | let multichainManifestPath = getMultichainManifestPath(projectDir); |
| 112 | if (!multichainManifestPath) { |
| 113 | throw new Error( |
| 114 | 'Selected project is not multi-chain. Please set correct file.\n\n https://academy.subquery.network/build/multi-chain.html' |
| 115 | ); |
| 116 | } |
| 117 | |
| 118 | multichainManifestPath = path.join(project.root, multichainManifestPath); |
| 119 | return {multichainManifestPath, fullPaths}; |
| 120 | } |
no test coverage detected