(args: FeaturesTestCommandInput, feature: string)
| 205 | } |
| 206 | |
| 207 | async function readFeatureMetadata(args: FeaturesTestCommandInput, feature: string): Promise<Feature> { |
| 208 | const { cliHost, collectionFolder } = args; |
| 209 | const featureSrcFolder = path.join(collectionFolder, 'src', feature); |
| 210 | |
| 211 | const metadataFile = path.join(featureSrcFolder, 'devcontainer-feature.json'); |
| 212 | if (!await (cliHost.isFile(metadataFile))) { |
| 213 | fail(`Feature '${feature}' does not contain a 'devcontainer-feature.json' file.`); |
| 214 | } |
| 215 | const buf = await cliHost.readFile(metadataFile); |
| 216 | if (!buf || buf.length === 0) { |
| 217 | fail(`Failed to read 'devcontainer-feature.json' file for feature '${feature}'`); |
| 218 | } |
| 219 | |
| 220 | return jsonc.parse(buf.toString()) as Feature; |
| 221 | } |
| 222 | |
| 223 | async function runFeatureTests(args: FeaturesTestCommandInput, testResults: TestResult[] = []): Promise<TestResult[]> { |
| 224 | const { baseImage, collectionFolder, remoteUser, cliHost, skipAutogenerated, skipScenarios, skipDuplicateTest } = args; |
no test coverage detected