diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 7e62645bd9fe..000000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "jest.pathToJest": "npm run jest --", - "editor.rulers": [ - 80 - ] -} diff --git a/integration_tests/__tests__/__snapshots__/custom-reporters-test.js.snap b/integration_tests/__tests__/__snapshots__/custom-reporters-test.js.snap new file mode 100644 index 000000000000..7cd86bd25226 --- /dev/null +++ b/integration_tests/__tests__/__snapshots__/custom-reporters-test.js.snap @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Custom Reporters Integration IncompleteReporter for flexibility 1`] = ` +"onRunComplete is called +Passed Tests: 1 +Failed Tests: 0 +Total Tests: 1 +" +`; + +exports[`Custom Reporters Integration TestReporter with all tests failing 1`] = ` +Object { + "onRunComplete": Object { + "called": true, + "config": "object", + "numFailedTests": 1, + "numPassedTests": 0, + "numTotalTests": 1, + }, + "onRunStart": Object { + "called": true, + "config": "object", + "options": "object", + }, + "onTestResult": Object { + "called": true, + "times": 1, + }, + "onTestStart": Object { + "called": true, + "config": false, + "path": true, + }, + "options": Object { + "christop": "pojer", + "dmitrii": "abramov", + "hello": "world", + }, +} +`; + +exports[`Custom Reporters Integration TestReporter with all tests passing 1`] = ` +Object { + "onRunComplete": Object { + "called": true, + "config": "object", + "numFailedTests": 0, + "numPassedTests": 1, + "numTotalTests": 1, + }, + "onRunStart": Object { + "called": true, + "config": "object", + "options": "object", + }, + "onTestResult": Object { + "called": true, + "times": 1, + }, + "onTestStart": Object { + "called": true, + "config": false, + "path": true, + }, + "options": Object { + "christop": "pojer", + "dmitrii": "abramov", + "hello": "world", + }, +} +`; + +exports[`Custom Reporters Integration invalid format for adding reporters 1`] = ` +"● Reporter Validation Error: + +Unexpected value for Path at index 0 of reporter at index 0 + Expected: + string + Got: + number + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html + +" +`; diff --git a/integration_tests/__tests__/custom-reporters-test.js b/integration_tests/__tests__/custom-reporters-test.js new file mode 100644 index 000000000000..183a8b81734f --- /dev/null +++ b/integration_tests/__tests__/custom-reporters-test.js @@ -0,0 +1,102 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ +'use strict'; + +const runJest = require('../runJest'); +const skipOnWindows = require('skipOnWindows'); + +describe('Custom Reporters Integration', () => { + skipOnWindows.suite(); + + test('valid string format for adding reporters', () => { + const reporterConfig = { + reporters: ['/reporters/TestReporter.js'], + }; + + const {status} = runJest('custom_reporters', [ + '--config', + JSON.stringify(reporterConfig), + 'add-test.js', + ]); + + expect(status).toBe(0); + }); + + test('valid array format for adding reporters', () => { + const reporterConfig = { + reporters: [ + ['/reporters/TestReporter.js', {'Dmitrii Abramov': 'Awesome'}], + ], + }; + + const {status} = runJest('custom_reporters', [ + '--config', + JSON.stringify(reporterConfig), + 'add-test.js', + ]); + + expect(status).toBe(0); + }); + + test('invalid format for adding reporters', () => { + const reporterConfig = { + reporters: [[3243242]], + }; + + const {status, stderr} = runJest('custom_reporters', [ + '--config', + JSON.stringify(reporterConfig), + 'add-test.js', + ]); + + expect(status).toBe(1); + expect(stderr).toMatchSnapshot(); + }); + + test('TestReporter with all tests passing', () => { + const { + stdout, + status, + stderr, + } = runJest('custom_reporters', ['add-test.js']); + const parsedJSON = JSON.parse(stdout); + + expect(status).toBe(0); + expect(stderr.trim()).toBe(''); + expect(parsedJSON).toMatchSnapshot(); + }); + + test('TestReporter with all tests failing', () => { + const { + stdout, + status, + stderr, + } = runJest('custom_reporters', ['add-fail-test.js']); + + const parsedJSON = JSON.parse(stdout); + + expect(status).toBe(1); + expect(stderr.trim()).toBe(''); + expect(parsedJSON).toMatchSnapshot(); + }); + + test('IncompleteReporter for flexibility', () => { + const {stderr, stdout, status} = runJest('custom_reporters', [ + '--config', + JSON.stringify({ + reporters: ['/reporters/IncompleteReporter.js'], + }), + 'add-test.js', + ]); + + expect(status).toBe(0); + expect(stderr.trim()).toBe(''); + + expect(stdout).toMatchSnapshot(); + }); +}); diff --git a/integration_tests/coverage_report/not-required-in-test-suite.js b/integration_tests/coverage_report/not-required-in-test-suite.js index c3ce8bb48301..747a45c65575 100644 --- a/integration_tests/coverage_report/not-required-in-test-suite.js +++ b/integration_tests/coverage_report/not-required-in-test-suite.js @@ -9,7 +9,7 @@ throw new Error( `this error should not be a problem because` + - `this file is never required or executed` + `this file is never required or executed`, ); // Flow annotations to make sure istanbul can instrument non ES6 source diff --git a/integration_tests/custom_reporters/__tests__/add-fail-test.js b/integration_tests/custom_reporters/__tests__/add-fail-test.js new file mode 100644 index 000000000000..ece775e4041b --- /dev/null +++ b/integration_tests/custom_reporters/__tests__/add-fail-test.js @@ -0,0 +1,9 @@ +const add = require('../add'); + +describe('CustomReporters', () => { + test('adds fail', () => { + expect(add(1, 3)).toBe(231); + expect(add(5, 7)).toBe(120); + expect(add(2, 4)).toBe(6); + }); +}); diff --git a/integration_tests/custom_reporters/__tests__/add-test.js b/integration_tests/custom_reporters/__tests__/add-test.js new file mode 100644 index 000000000000..a2130ede580c --- /dev/null +++ b/integration_tests/custom_reporters/__tests__/add-test.js @@ -0,0 +1,9 @@ +const add = require('../add'); + +describe('Custom Reporters', () => { + test('adds ok', () => { + expect(add(1, 2)).toBe(3); + expect(add(3, 4)).toBe(7); + expect(add(12, 24)).toBe(36); + }); +}); diff --git a/integration_tests/custom_reporters/add.js b/integration_tests/custom_reporters/add.js new file mode 100644 index 000000000000..a7276b3dd0a9 --- /dev/null +++ b/integration_tests/custom_reporters/add.js @@ -0,0 +1,3 @@ +module.exports = function add(x, y) { + return x + y; +}; diff --git a/integration_tests/custom_reporters/package.json b/integration_tests/custom_reporters/package.json new file mode 100644 index 000000000000..6fa9b322698e --- /dev/null +++ b/integration_tests/custom_reporters/package.json @@ -0,0 +1,11 @@ +{ + "jest": { + "reporters": [ + ["/reporters/TestReporter.js", { + "hello": "world", + "dmitrii": "abramov", + "christop": "pojer" + }] + ] + } +} diff --git a/integration_tests/custom_reporters/reporters/IncompleteReporter.js b/integration_tests/custom_reporters/reporters/IncompleteReporter.js new file mode 100644 index 000000000000..232a5b84c7a4 --- /dev/null +++ b/integration_tests/custom_reporters/reporters/IncompleteReporter.js @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +/** + * IncompleteReporter + * Reporter to test for the flexibility of the interface we implemented. + * The reporters shouldn't be required to implement all the methods + * + * This only implements one mehtod onRunComplete which should be called + */ +class IncompleteReporter { + constructor(options) { + this.options = {}; + } + + onRunComplete(config, results) { + console.log('onRunComplete is called'); + console.log('Passed Tests: ' + results.numPassedTests); + console.log('Failed Tests: ' + results.numFailedTests); + console.log('Total Tests: ' + results.numTotalTests); + } +} + +module.exports = IncompleteReporter; diff --git a/integration_tests/custom_reporters/reporters/TestReporter.js b/integration_tests/custom_reporters/reporters/TestReporter.js new file mode 100644 index 000000000000..5a057c9194c1 --- /dev/null +++ b/integration_tests/custom_reporters/reporters/TestReporter.js @@ -0,0 +1,87 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +/** + * TestReporter + * Reporter for testing the outputs, without any extra + * hassle. Uses a JSON like syntax for testing the reporters + * instead of outputting the text to stdout and using match functions + * to get the output. + */ +class TestReporter { + constructor(options) { + this._options = options; + + /** + * statsCollected property + * contains most of the statistics + * related to the object to be called, + * This here helps us in avoiding the string match + * statements nothing else + */ + this._statsCollected = { + onRunComplete: {}, + onRunStart: {}, + onTestResult: {times: 0}, + onTestStart: {}, + options, + }; + } + + /** + * clearLine + * clears the line for easier JSON parsing + */ + clearLine() { + if (process.stdout.isTTY) { + process.stderr.write('\x1b[999D\x1b[K'); + } + } + + onTestStart(config, path) { + const onTestStart = this._statsCollected.onTestStart; + + onTestStart.called = true; + onTestStart.config = config === undefined; + onTestStart.path = typeof path === 'string'; + } + + onTestResult(config, testResult, results) { + const onTestResult = this._statsCollected.onTestResult; + + onTestResult.called = true; + onTestResult.times++; + } + + onRunStart(config, results, options) { + this.clearLine(); + const onRunStart = this._statsCollected.onRunStart; + + onRunStart.called = true; + onRunStart.config = typeof config; + onRunStart.options = typeof options; + } + + onRunComplete(config, results) { + const onRunComplete = this._statsCollected.onRunComplete; + + onRunComplete.called = true; + onRunComplete.config = typeof config; + + onRunComplete.numPassedTests = results.numPassedTests; + onRunComplete.numFailedTests = results.numFailedTests; + onRunComplete.numTotalTests = results.numTotalTests; + + // The Final Call + process.stdout.write(JSON.stringify(this._statsCollected, null, 4)); + } +} + +module.exports = TestReporter; diff --git a/packages/jest-cli/src/ReporterDispatcher.js b/packages/jest-cli/src/ReporterDispatcher.js new file mode 100644 index 000000000000..9259eb4bc35b --- /dev/null +++ b/packages/jest-cli/src/ReporterDispatcher.js @@ -0,0 +1,90 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @flow + */ + +'use strict'; + +import type {GlobalConfig} from 'types/Config'; +import type {Context} from 'types/Context'; +import type {Test} from 'types/TestRunner'; +import type {TestResult, AggregatedResult} from 'types/TestResult'; +import type BaseReporter from './reporters/BaseReporter'; +import type {ReporterOnStartOptions} from 'types/Reporters'; + +export type RunOptions = { + estimatedTime: number, + showStatus: boolean, +}; + +class ReporterDispatcher { + _disabled: boolean; + _reporters: Array; + + constructor() { + this._reporters = []; + } + + register(reporter: BaseReporter): void { + this._reporters.push(reporter); + } + + unregister(ReporterClass: Function) { + this._reporters = this._reporters.filter( + reporter => !(reporter instanceof ReporterClass), + ); + } + + onTestResult( + test: Test, + testResult: TestResult, + results: AggregatedResult, + ) { + this._reporters.forEach(reporter => + reporter.onTestResult(test, testResult, results), + ); + } + + onTestStart(test: Test) { + this._reporters.forEach(reporter => reporter.onTestStart(test)); + } + + onRunStart( + config: GlobalConfig, + results: AggregatedResult, + options: ReporterOnStartOptions, + ) { + this._reporters.forEach(reporter => + reporter.onRunStart(config, results, options), + ); + } + + onRunComplete( + contexts: Set, + config: GlobalConfig, + results: AggregatedResult, + ) { + this._reporters.forEach(reporter => + reporter.onRunComplete(contexts, config, results), + ); + } + + // Return a list of last errors for every reporter + getErrors(): Array { + return this._reporters.reduce((list, reporter) => { + const error = reporter.getLastError(); + return error ? list.concat(error) : list; + }, []); + } + + hasErrors(): boolean { + return this.getErrors().length !== 0; + } +} + +module.exports = ReporterDispatcher; diff --git a/packages/jest-cli/src/TestRunner.js b/packages/jest-cli/src/TestRunner.js index a6833ddd01d2..3fc47d716947 100644 --- a/packages/jest-cli/src/TestRunner.js +++ b/packages/jest-cli/src/TestRunner.js @@ -14,11 +14,10 @@ import type { SerializableError as TestError, TestResult, } from 'types/TestResult'; -import type {GlobalConfig} from 'types/Config'; +import type {Config, GlobalConfig, ReporterConfig} from 'types/Config'; import type {Context} from 'types/Context'; import type {PathPattern} from './SearchSource'; import type {Test, Tests} from 'types/TestRunner'; -import type BaseReporter from './reporters/BaseReporter'; const {formatExecError} = require('jest-message-util'); @@ -32,7 +31,10 @@ const snapshot = require('jest-snapshot'); const throat = require('throat'); const workerFarm = require('worker-farm'); const TestWatcher = require('./TestWatcher'); +const ReporterDispatcher = require('./ReporterDispatcher'); +const chalk = require('chalk'); +const DEFAULT_REPORTER_LABEL = 'default'; const SLOW_TEST_TIME = 3000; class CancelRun extends Error { @@ -67,7 +69,7 @@ class TestRunner { this._setupReporters(); } - addReporter(reporter: BaseReporter) { + addReporter(reporter: Object) { this._dispatcher.register(reporter); } @@ -273,14 +275,30 @@ class TestRunner { return Promise.race([runAllTests, onInterrupt]).then(cleanup, cleanup); } + /** + * Checks if default reporters should be added or not + * @private + */ + _shouldAddDefaultReporters(reporters?: Array): boolean { + return !reporters || reporters.indexOf(DEFAULT_REPORTER_LABEL) !== -1; + } + + /** + * Main method to Setup reporters to be used with TestRunner + * @private + */ _setupReporters() { const config = this._config; + const reporters = config.reporters; + const isDefault: boolean = this._shouldAddDefaultReporters(reporters); - this.addReporter( - config.verbose - ? new VerboseReporter({expand: config.expand}) - : new DefaultReporter(), - ); + if (isDefault) { + this._setupDefaultReporters(config); + } + + if (reporters && Array.isArray(reporters)) { + this._addCustomReporters(reporters); + } if (config.collectCoverage) { // coverage reporter dependency graph is pretty big and we don't @@ -289,12 +307,64 @@ class TestRunner { this.addReporter(new CoverageReporter()); } - this.addReporter(new SummaryReporter(this._options)); + if (config.notify) { this.addReporter(new NotifyReporter(this._options.startRun)); } } + _setupDefaultReporters(config: GlobalConfig) { + this.addReporter( + config.verbose ? new VerboseReporter(config) : new DefaultReporter(), + ); + + this.addReporter(new SummaryReporter(this._options)); + } + + /** + * Adds Custom reporters to Jest + * @private + */ + _addCustomReporters(reporters: Array) { + const customReporter = reporters.filter(reporter => reporter !== 'default'); + + customReporter.forEach((reporter, index) => { + const {options, path} = this._getReporterProps(reporter); + + try { + const Reporter = require(path); + this.addReporter(new Reporter(options)); + } catch (error) { + console.error( + chalk.red( + 'An error occured while adding the reporter at path ' + path, + ), + ); + throw error; + } + }); + } + + /** + * Get properties of a reporter in an object + * to make dealing with them less painful + * + * Objects contain the following properties: + * - options + * - path + */ + _getReporterProps(reporter: ReporterConfig): Object { + let props = {}; + if (typeof reporter === 'string') { + props = {path: reporter}; + } else if (Array.isArray(reporter)) { + const [path, options] = reporter; + props = {options, path}; + } + + return props; + } + _bailIfNeeded( contexts: Set, aggregatedResults: AggregatedResult, @@ -429,59 +499,6 @@ const buildFailureTestResult = ( }; }; -class ReporterDispatcher { - _disabled: boolean; - _reporters: Array; - - constructor() { - this._reporters = []; - } - - register(reporter: BaseReporter): void { - this._reporters.push(reporter); - } - - unregister(ReporterClass: Function) { - this._reporters = this._reporters.filter( - reporter => !(reporter instanceof ReporterClass), - ); - } - - onTestResult(test, testResult, results) { - this._reporters.forEach(reporter => - reporter.onTestResult(test, testResult, results), - ); - } - - onTestStart(test) { - this._reporters.forEach(reporter => reporter.onTestStart(test)); - } - - onRunStart(config, results, options) { - this._reporters.forEach(reporter => - reporter.onRunStart(config, results, options), - ); - } - - onRunComplete(contexts, config, results) { - this._reporters.forEach(reporter => - reporter.onRunComplete(contexts, config, results), - ); - } - - // Return a list of last errors for every reporter - getErrors(): Array { - return this._reporters.reduce((list, reporter) => { - const error = reporter.getLastError(); - return error ? list.concat(error) : list; - }, []); - } - - hasErrors(): boolean { - return this.getErrors().length !== 0; - } -} - const getEstimatedTime = (timings, workers) => { if (!timings.length) { return 0; diff --git a/packages/jest-cli/src/reporters/VerboseReporter.js b/packages/jest-cli/src/reporters/VerboseReporter.js index c77c7d57f512..bc63100bc4f8 100644 --- a/packages/jest-cli/src/reporters/VerboseReporter.js +++ b/packages/jest-cli/src/reporters/VerboseReporter.js @@ -9,6 +9,7 @@ */ 'use strict'; +import type {GlobalConfig} from 'types/Config'; import type { AggregatedResult, AssertionResult, @@ -21,14 +22,10 @@ const DefaultReporter = require('./DefaultReporter'); const chalk = require('chalk'); const {ICONS} = require('../constants'); -type Options = {| - expand: boolean, -|}; - class VerboseReporter extends DefaultReporter { - _options: Options; + _options: GlobalConfig; - constructor(options: Options) { + constructor(options: GlobalConfig) { super(); this._options = options; } diff --git a/packages/jest-config/src/normalize.js b/packages/jest-config/src/normalize.js index 5cec63a6f5cc..0e2757181933 100644 --- a/packages/jest-config/src/normalize.js +++ b/packages/jest-config/src/normalize.js @@ -32,6 +32,7 @@ const DEPRECATED_CONFIG = require('./deprecated'); const JSON_EXTENSION = '.json'; const PRESET_NAME = 'jest-preset' + JSON_EXTENSION; const ERROR = `${BULLET}Validation Error`; +const {validateReporters} = require('./reporterValidationErrors'); const createConfigError = message => new ValidationError(ERROR, message, DOCUMENTATION_NOTE); @@ -247,6 +248,10 @@ function normalize(config: InitialConfig, argv: Object = {}) { exampleConfig: VALID_CONFIG, }); + if (config.reporters && Array.isArray(config.reporters)) { + validateReporters(config.reporters); + } + normalizePreprocessor(config); normalizeRootDir(config); normalizeMissingOptions(config); @@ -356,6 +361,7 @@ function normalize(config: InitialConfig, argv: Object = {}) { case 'notify': case 'preset': case 'replname': + case 'reporters': case 'resetMocks': case 'resetModules': case 'rootDir': diff --git a/packages/jest-config/src/reporterValidationErrors.js b/packages/jest-config/src/reporterValidationErrors.js new file mode 100644 index 000000000000..173e7249ca61 --- /dev/null +++ b/packages/jest-config/src/reporterValidationErrors.js @@ -0,0 +1,101 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ +const {ValidationError} = require('jest-validate'); +const {DOCUMENTATION_NOTE, BULLET} = require('./utils'); + +const chalk = require('chalk'); +const {getType} = require('jest-matcher-utils'); + +const validReporterTypes = ['array', 'string']; +const ERROR = `${BULLET} Reporter Validation Error`; + +/** + * Reporter Vaidation Error is thrown if the given arguments + * within the reporter are not valid + * + * This is a highly specific reporter error and in the future will be + * merged with jest-validate. Till then, we can make use of it. It works + * and that's what counts most at this time + */ +function createReporterError( + reporterIndex: number, + reporterValue: any, +): ValidationError { + const errorMessage = `Reporter at index ${reporterIndex} must be of type:\n` + + ` ${chalk.bold.green(validReporterTypes.join(' or '))}\n` + + ` but instead received:\n` + + ` ${chalk.bold.red(getType(reporterValue))}`; + + return new ValidationError(ERROR, errorMessage, DOCUMENTATION_NOTE); +} + +/** + * Reporter Error specific to Array configuration + */ +function createArrayReporterError( + reporterIndex: number, + valueIndex: number, + value: any, + expectedType: string, + valueName: string, +): ValidationError { + const errorMessage = `Unexpected value for ${valueName} ` + + `at index ${valueIndex} of reporter at index ${reporterIndex}\n` + + ' Expected:\n' + + ` ${chalk.bold.red(expectedType)}\n` + + ' Got:\n' + + ` ${chalk.bold.green(getType(value))}`; + + return new ValidationError(ERROR, errorMessage, DOCUMENTATION_NOTE); +} + +/** + * validates each reporter provided in the configuration + * @private + */ +function validateReporters(reporterConfig: Array): boolean { + return reporterConfig.every((reporter, index) => { + if (Array.isArray(reporter)) { + validateArrayReporter(reporter, index); + } else if (typeof reporter !== 'string') { + throw createReporterError(index, reporter); + } + + return true; + }); +} + +/** + * validates values within the array reporter + * + * @param {Array} arrayReporter reporter to be validated + * @returns {boolean} true if the reporter was validated + */ +function validateArrayReporter( + arrayReporter: Array, + reporterIndex: number, +) { + const [path, options] = arrayReporter; + if (typeof path !== 'string') { + throw createArrayReporterError(reporterIndex, 0, path, 'string', 'Path'); + } else if (typeof options !== 'object') { + throw createArrayReporterError( + reporterIndex, + 1, + options, + 'object', + 'Reporter Configuration', + ); + } +} + +module.exports = { + createArrayReporterError, + createReporterError, + validateReporters, +}; diff --git a/packages/jest-config/src/validConfig.js b/packages/jest-config/src/validConfig.js index f43b6de2d02d..19c1585dd0b5 100644 --- a/packages/jest-config/src/validConfig.js +++ b/packages/jest-config/src/validConfig.js @@ -58,6 +58,11 @@ module.exports = ({ noStackTrace: false, notify: false, preset: 'react-native', + reporters: [ + 'default', + 'custom-reporter-1', + ['custom-reporter-2', {configValue: true}], + ], resetMocks: false, resetModules: false, resolver: '/resolver.js', diff --git a/types/Config.js b/types/Config.js index 38a9e7bc9e3c..c8a5825dffec 100644 --- a/types/Config.js +++ b/types/Config.js @@ -19,6 +19,10 @@ export type HasteConfig = {| providesModuleNodeModules: Array, |}; +export type ReporterConfig = StringReporter | ArrayReporter; +export type StringReporter = string; +export type ArrayReporter = [string, Object]; + export type ConfigGlobals = Object; export type GlobalConfig = { @@ -38,6 +42,7 @@ export type GlobalConfig = { noStackTrace: boolean, notify: boolean, replname: ?string, + reporters: Array, rootDir: Path, silent: boolean, testNamePattern: string, @@ -117,6 +122,7 @@ export type Config = {| notify: boolean, preset: ?string, replname: ?string, + reporters: Array, resetMocks: boolean, resetModules: boolean, resolver: ?Path, @@ -163,6 +169,7 @@ export type InitialConfig = {| forceExit?: boolean, globals?: ConfigGlobals, haste?: HasteConfig, + reporters?: Array, logHeapUsage?: boolean, logTransformErrors?: ?boolean, mapCoverage?: boolean, diff --git a/yarn.lock b/yarn.lock index 7a21ecec9e1c..30eb5d7b5eb2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -35,8 +35,8 @@ ajv-keywords@^1.0.0: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" ajv@^4.7.0, ajv@^4.9.1: - version "4.11.7" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.7.tgz#8655a5d86d0824985cc471a1d913fb6729a0ec48" + version "4.11.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.6.tgz#947e93049790942b2a2d60a8289b28924d39f987" dependencies: co "^4.6.0" json-stable-stringify "^1.0.1" @@ -94,8 +94,8 @@ arr-diff@^2.0.0: arr-flatten "^1.0.1" arr-flatten@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" + version "1.0.1" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.1.tgz#e5ffe54d45e19f32f216e91eb99c8ce892bb604b" array-equal@^1.0.0: version "1.0.0" @@ -205,8 +205,8 @@ babel-core@^6.23.1, babel-core@^6.24.1: source-map "^0.5.0" babel-eslint@^7.1.1: - version "7.2.2" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.2.tgz#0da2cbe6554fd0fb069f19674f2db2f9c59270ff" + version "7.2.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.1.tgz#079422eb73ba811e3ca0865ce87af29327f8c52f" dependencies: babel-code-frame "^6.22.0" babel-traverse "^6.23.1" @@ -866,8 +866,8 @@ camelcase@^2.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" caniuse-db@^1.0.30000639: - version "1.0.30000655" - resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000655.tgz#e40b6287adc938848d6708ef83d65b5f54ac1874" + version "1.0.30000657" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000657.tgz#8192aec745019cc050217ad049c60dad21e3d1bc" caseless@~0.12.0: version "0.12.0" @@ -1220,8 +1220,8 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" electron-to-chromium@^1.2.7: - version "1.3.3" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.3.tgz#651eb63fe89f39db70ffc8dbd5d9b66958bc6a0e" + version "1.3.6" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.6.tgz#b90ff7e9094e6f7dd343761a001e82592d937db2" encoding@^0.1.11: version "0.1.12" @@ -1680,8 +1680,8 @@ glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1: path-is-absolute "^1.0.0" global@^4.3.0: - version "4.3.1" - resolved "https://registry.yarnpkg.com/global/-/global-4.3.1.tgz#5f757908c7cbabce54f386ae440e11e26b7916df" + version "4.3.2" + resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" dependencies: min-document "^2.19.0" process "~0.5.1" @@ -1767,8 +1767,8 @@ home-or-tmp@^2.0.0: os-tmpdir "^1.0.1" hosted-git-info@^2.1.4: - version "2.4.2" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67" + version "2.4.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.1.tgz#4b0445e41c004a8bd1337773a4ff790ca40318c8" html-encoding-sniffer@^1.0.1: version "1.0.1" @@ -2704,8 +2704,8 @@ preserve@^0.2.0: resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" prettier@1.2.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.1.0.tgz#9d6ad005703efefa66b6999b8916bfc6afeaf9f8" + version "1.2.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.2.0.tgz#6165611aea1328fefc96b9d144b73133cde0474e" dependencies: ast-types "0.9.8" babel-code-frame "6.22.0" @@ -3160,8 +3160,8 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" sshpk@^1.7.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.0.tgz#ff2a3e4fd04497555fed97b39a0fd82fafb3a33c" + version "1.11.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.11.0.tgz#2d8d5ebb4a6fab28ffba37fa62a90f4a3ea59d77" dependencies: asn1 "~0.2.3" assert-plus "^1.0.0"