diff --git a/build-system/tasks/report-test-status.js b/build-system/tasks/report-test-status.js index 29d6ef9ae3ad4..41468811d45c6 100644 --- a/build-system/tasks/report-test-status.js +++ b/build-system/tasks/report-test-status.js @@ -136,7 +136,7 @@ async function postReport(type, action) { 'Content-Type': 'application/json', }, }); - const body = await response.text(); + const body = /** @type {string} */ (await response.text()); log('Reported', cyan(`${type}/${action}`), 'to GitHub'); if (body.length > 0) { @@ -211,7 +211,11 @@ async function reportAllExpectedTests() { * Callback to the Karma.Server on('run_complete') event for simple test types. * Optionally takes an object containing test results if they were run. * - * @param {?Karma.TestResults} results + * @param {?{ + * error: string|number, + * failed: string|number, + * success: string|number, + * }} results */ async function reportTestRunComplete(results) { if (!results || results.error) { diff --git a/build-system/tasks/serve.js b/build-system/tasks/serve.js index 66ac0270ebfbc..23dbe8d9d0cf4 100644 --- a/build-system/tasks/serve.js +++ b/build-system/tasks/serve.js @@ -105,6 +105,18 @@ async function startServer( started = resolve; }); setServeMode(modeOptions); + /** + * @type {{ + * name: string, + * root: string, + * host: string, + * port: number, + * https: string, + * preferHttp1: boolean, + * silent: boolean, + * middleware: function[], + * }} + */ const options = { name: 'AMP Dev Server', root: process.cwd(), @@ -161,7 +173,7 @@ function resetServerFiles() { async function stopServer() { if (url) { connect.serverClose(); - log(green('Stopped server at'), cyan(url)); + log(green('Stopped server at'), cyan(/** @type {string} */ (url))); url = null; } } diff --git a/build-system/tasks/test-report-upload.js b/build-system/tasks/test-report-upload.js index d0ed6e48e5683..11e8301b3c136 100644 --- a/build-system/tasks/test-report-upload.js +++ b/build-system/tasks/test-report-upload.js @@ -120,7 +120,7 @@ async function sendCiKarmaReport(testType) { 'failed to report results of type', cyan(testType), ': \n', - yellow(await response.text()) + yellow(/** @type {string} */ (await response.text())) ); } } diff --git a/build-system/test-configs/jscodeshift/index.js b/build-system/test-configs/jscodeshift/index.js index 3b50d3f18fe7d..2efb1f15194b9 100644 --- a/build-system/test-configs/jscodeshift/index.js +++ b/build-system/test-configs/jscodeshift/index.js @@ -27,14 +27,14 @@ const command = (args = []) => /** * @param {Array} args - * @param {Object} opts - * @return {string} + * @param {?Object=} opts + * @return {!Object} */ const jscodeshift = (args = [], opts) => getOutput(command(args), opts); /** * @param {Array} args - * @param {?Object=} opts + * @param {Object} opts * @return {ReturnType} */ const jscodeshiftAsync = (args = [], opts) =>