* Runs the test in a single input file * * @param {string} inputFile * @return {Promise }
(inputFile)
| 161 | * @return {Promise<void>} |
| 162 | */ |
| 163 | async function runTest(inputFile) { |
| 164 | const testName = getTestName(inputFile); |
| 165 | const [input, expectedOutput, transform] = await Promise.all([ |
| 166 | getInput(inputFile), |
| 167 | getExpectedOutput(inputFile), |
| 168 | getTransform(inputFile, loadOptions(inputFile)), |
| 169 | ]); |
| 170 | const output = await getOutput(transform, input); |
| 171 | try { |
| 172 | assert.strictEqual(output, expectedOutput); |
| 173 | } catch (err) { |
| 174 | ++failed; |
| 175 | logError(testName, err); |
| 176 | return; |
| 177 | } |
| 178 | ++passed; |
| 179 | logWithoutTimestampLocalDev(green('✔'), 'Passed', cyan(testName)); |
| 180 | } |
| 181 | |
| 182 | /** |
| 183 | * Tests for AMP server custom transforms. Entry point for `amp server-tests`. |
no test coverage detected