MCPcopy
hub / github.com/ampproject/amphtml / inquireForTestFunction_

Function inquireForTestFunction_

build-system/tasks/visual-diff/dev-mode.js:165–179  ·  view source on GitHub ↗

* Queries the user for an interactive test, or selects the base case if none. * * @param {!WebpageDef} webpage a JSON object containing details about the * webpage to snapshot. * @return {Promise }

(webpage)

Source from the content-addressed store, hash-verified

163 * @return {Promise<string>}
164 */
165async function inquireForTestFunction_(webpage) {
166 if (Object.keys(webpage.tests_).length > 1) {
167 return await inquirer.select({
168 message:
169 'Select which interactive test from ' +
170 cyan(webpage.interactive_tests) +
171 ' to run:',
172 choices: Object.keys(webpage.tests_).map((testName) => ({
173 name: testName || '(base test)',
174 value: testName,
175 })),
176 });
177 }
178 return '';
179}
180
181module.exports = {
182 devMode,

Callers 1

devModeFunction · 0.85

Calls 2

cyanFunction · 0.85
selectMethod · 0.80

Tested by

no test coverage detected