(feature: string, workspaceFolder: string, featureTestFolder: string, args: FeaturesTestCommandInput, testResults: TestResult[] = [])
| 297 | } |
| 298 | |
| 299 | async function doRunAutoTest(feature: string, workspaceFolder: string, featureTestFolder: string, args: FeaturesTestCommandInput, testResults: TestResult[] = []): Promise<TestResult[]> { |
| 300 | const { cliHost } = args; |
| 301 | const testScriptPath = path.join(featureTestFolder, 'test.sh'); |
| 302 | if (!(await cliHost.isFile(testScriptPath))) { |
| 303 | fail(`Could not find test.sh script at ${testScriptPath}`); |
| 304 | } |
| 305 | |
| 306 | // Move the entire test directory for the given Feature into the workspaceFolder |
| 307 | await cpDirectoryLocal(featureTestFolder, workspaceFolder); |
| 308 | |
| 309 | // Move the test library script into the workspaceFolder test scripts folder. |
| 310 | await cliHost.writeFile(path.join(workspaceFolder, TEST_LIBRARY_SCRIPT_NAME), Buffer.from(testLibraryScript)); |
| 311 | |
| 312 | // Execute Test |
| 313 | const result = await execTest('test.sh', workspaceFolder, cliHost); |
| 314 | testResults.push({ |
| 315 | testName: feature, |
| 316 | result, |
| 317 | }); |
| 318 | |
| 319 | return testResults; |
| 320 | } |
| 321 | |
| 322 | async function doScenario(pathToTestDir: string, targetFeatureOrGlobal: string, args: FeaturesTestCommandInput, testResults: TestResult[] = []): Promise<TestResult[]> { |
| 323 | const { collectionFolder, cliHost, filter } = args; |
no test coverage detected