Skip to content

Commit

Permalink
fix more type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyajones committed Apr 30, 2021
1 parent c3522dc commit 6f21d16
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
8 changes: 6 additions & 2 deletions build-system/tasks/report-test-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
14 changes: 13 additions & 1 deletion build-system/tasks/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion build-system/tasks/test-report-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions build-system/test-configs/jscodeshift/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ const command = (args = []) =>

/**
* @param {Array<string>} args
* @param {Object} opts
* @return {string}
* @param {?Object=} opts
* @return {!Object}
*/
const jscodeshift = (args = [], opts) => getOutput(command(args), opts);

/**
* @param {Array<string>} args
* @param {?Object=} opts
* @param {Object} opts
* @return {ReturnType<execScriptAsync>}
*/
const jscodeshiftAsync = (args = [], opts) =>
Expand Down

0 comments on commit 6f21d16

Please sign in to comment.