From c83e901ca812968e5c8235b9c08a1d80f2c766b2 Mon Sep 17 00:00:00 2001 From: Hongfei Ding Date: Thu, 20 Dec 2018 20:45:59 -0800 Subject: [PATCH] No amp4test log on travis. (#19611) * No amp4test log on travis. * read --files to enable logging * Update js doc * clean up * print error in correct format * also do --verbose * use --verbose * Update js doc --- build-system/amp4test.js | 11 +++++++---- build-system/tasks/runtime-test.js | 2 -- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build-system/amp4test.js b/build-system/amp4test.js index 5984de9df166..06e3686bbb1a 100644 --- a/build-system/amp4test.js +++ b/build-system/amp4test.js @@ -16,17 +16,20 @@ 'use strict'; const app = module.exports = require('express').Router(); +const minimist = require('minimist'); +const argv = minimist( + process.argv.slice(2), {boolean: ['strictBabelTransform']}); + /* eslint-disable max-len */ /** - * Logs the given messages to the console in local dev mode, but not while - * running automated tests. + * Logs the given messages to the console when --verbose is specified. * @param {*} messages */ function log(...messages) { - if (!process.env.AMP_TEST) { - console.log(messages); + if (argv.verbose) { + console.log.apply(console, messages); } } diff --git a/build-system/tasks/runtime-test.js b/build-system/tasks/runtime-test.js index 01bf37948108..8fdb5746c2b4 100644 --- a/build-system/tasks/runtime-test.js +++ b/build-system/tasks/runtime-test.js @@ -544,8 +544,6 @@ async function runTests() { }; } - // Run fake-server to test XHR responses. - process.env.AMP_TEST = 'true'; const server = gulp.src(process.cwd(), {base: '.'}).pipe(webserver({ port: 8081, host: 'localhost',