Skip to content

Commit

Permalink
No amp4test log on travis. (#19611)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
lannka committed Dec 21, 2018
1 parent d80554e commit c83e901
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 7 additions & 4 deletions build-system/amp4test.js
Expand Up @@ -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);
}
}

Expand Down
2 changes: 0 additions & 2 deletions build-system/tasks/runtime-test.js
Expand Up @@ -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',
Expand Down

0 comments on commit c83e901

Please sign in to comment.