Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom reporter integration #3064

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
98d01b5
add custom reporters option in TestRunner
abdulhannanali Mar 3, 2017
1215c0b
add reporters option in jest-cli config
abdulhannanali Mar 4, 2017
b3196ac
add flowtype for reporters option
abdulhannanali Mar 4, 2017
44f6550
add key for reporters in validConfig
abdulhannanali Mar 4, 2017
aa548c9
add noDefaultReporters option
abdulhannanali Mar 5, 2017
268a640
Lint
abdulhannanali Mar 5, 2017
e79ae0c
add unit tests for _addCustomReporters
abdulhannanali Mar 5, 2017
2ee53ce
separate default reporters in method in TestRunner
abdulhannanali Mar 6, 2017
073d6e9
add tests for errors which are thrown
abdulhannanali Mar 6, 2017
6a430de
add tests for .noDefaultReporters
abdulhannanali Mar 6, 2017
329df49
Merge branch 'master' into reporter-config
abdulhannanali Mar 6, 2017
7cc7aea
modify Error thrown for _addCustomReporters
abdulhannanali Mar 8, 2017
138bec3
remove superfluous comment from TestRunner.js
abdulhannanali Mar 8, 2017
6da8dad
remove reporter tests from TestRunner-test.js
abdulhannanali Apr 1, 2017
352380b
add new custom reporters format in TestRunner.js
abdulhannanali Apr 1, 2017
1a5ac39
update the format for adding customReporter
abdulhannanali Apr 1, 2017
124ee97
Merge branch 'master' into reporter-config
abdulhannanali Apr 1, 2017
d067e59
add descriptive validations for reporters
abdulhannanali Apr 1, 2017
302b672
add reporters attibute in normalize.js
abdulhannanali Apr 1, 2017
a9e9fce
add prettier to types
abdulhannanali Apr 1, 2017
31b51e3
Seperate out ReporterDispatcher in a file
abdulhannanali Apr 1, 2017
75e39d1
add elaborate messages for errors
abdulhannanali Apr 1, 2017
12e5382
add Facebook Copyright header to ReporterDispatcher.js
abdulhannanali Apr 1, 2017
08bd0cf
typecheck and lint properly
abdulhannanali Apr 1, 2017
8bf1bb8
correcting a condition in ReporterDispatcher
abdulhannanali Apr 2, 2017
06e7103
rename method to `_shouldAddDefaultReporters`
abdulhannanali Apr 2, 2017
32dcff4
add integration tests for custom_reporters
abdulhannanali Apr 2, 2017
45656ad
add more complete integration tests for reporters
abdulhannanali Apr 2, 2017
15abe4e
remove AggregatedResults.js
abdulhannanali Apr 2, 2017
76ebadb
remove any methods to be validated
abdulhannanali Apr 2, 2017
e158496
correct _addDefaultReporters call
abdulhannanali Apr 2, 2017
80c88db
remove "reporters" validations from TestRunner.js
abdulhannanali Apr 3, 2017
4a33e50
add pretty validations for custom reporters
abdulhannanali Apr 3, 2017
352f219
remove comment
abdulhannanali Apr 3, 2017
03c2045
add reporter validation in normalize.js
abdulhannanali Apr 3, 2017
8dd5ef3
keep comments precise remove unwanted
abdulhannanali Apr 3, 2017
27c5533
check if reporters exist before validation
abdulhannanali Apr 3, 2017
cebb62e
pretty custom reporters
abdulhannanali Apr 4, 2017
e36d442
prettier integration_tests
abdulhannanali Apr 4, 2017
593040c
prettier
abdulhannanali Apr 4, 2017
c94c993
yarn prettier
abdulhannanali Apr 4, 2017
fc8a4d3
prettier
abdulhannanali Apr 4, 2017
cfdcccf
Remove unnecessary comments from TestRunner.js
abdulhannanali Apr 4, 2017
552d0e2
make ReporterConfig type in types/Config simpler
abdulhannanali Apr 4, 2017
7d903c9
remove comments
abdulhannanali Apr 4, 2017
1aa5d54
correct types and change method signatures
abdulhannanali Apr 4, 2017
599c6ed
remove bug from reporterValidationErrors.js
abdulhannanali Apr 5, 2017
b5aa966
make custom_reporters tests more concise
abdulhannanali Apr 5, 2017
d1cf92e
fix lint error in website
abdulhannanali Apr 5, 2017
23a7610
finalize types for reporters
abdulhannanali Apr 5, 2017
dd2d652
yarn prettier
abdulhannanali Apr 5, 2017
33640be
remove .vscode folder
abdulhannanali Apr 5, 2017
937a3c9
all integration_tests are prettier now
abdulhannanali Apr 5, 2017
6dc65fb
Merge branch 'master' into reporter-config
abdulhannanali Apr 5, 2017
492e0de
remove validateReporters call
abdulhannanali Apr 5, 2017
8c486e7
remove usage of \t in reporter validation errors
abdulhannanali Apr 10, 2017
e328f93
change spread operator with usage of .apply
abdulhannanali Apr 10, 2017
bfad068
modify custom_reporters integration_tests to suit node 4
abdulhannanali Apr 11, 2017
f4ed436
prettier validations
abdulhannanali Apr 11, 2017
3b154d2
Merge remote-tracking branch 'remotes/upstream/master' into reporter-…
abdulhannanali Apr 11, 2017
f6fa7bb
prettier :heart:
abdulhannanali Apr 11, 2017
9ac6de0
pretty lint
abdulhannanali Apr 11, 2017
e093125
update lock file
abdulhannanali Apr 11, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"jest.pathToJest": "npm run jest --",
"editor.rulers": [
80
]
],
"eslint.enable": true,
"javascript.validate.enable": false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm.. should we really add this here? Shall we do it in a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a big mistake. I get this committed with each PR I do, as this is part of my development workflow. Sorry! Will remove it.

}
79 changes: 73 additions & 6 deletions packages/jest-cli/src/TestRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,16 @@ class TestRunner {
_setupReporters() {
const config = this._config;

this.addReporter(
config.verbose
? new VerboseReporter(config)
: new DefaultReporter(),
);
if (config.reporters) {
this._addCustomReporters(config.reporters);
}

// Default Reporters are setup when
// noDefaultReporters is false, which is false by default
// and can be set to true in configuration.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is superfluous as it describes what the if statement does. Mind removing it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, need to get over this habit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments that describe what statements does are superfluous. Noted! Will remove them!

if (!config.noDefaultReporters) {
this._setupDefaultReporters();
}

if (config.collectCoverage) {
// coverage reporter dependency graph is pretty big and we don't
Expand All @@ -392,12 +397,74 @@ class TestRunner {
this.addReporter(new CoverageReporter());
}

this.addReporter(new SummaryReporter());
if (config.notify) {
this.addReporter(new NotifyReporter(this._startRun));
}
}

/**
* _setupDefaultReporters
* Method for setting up the default reporters
*/
_setupDefaultReporters() {
const config = this._config;

this.addReporter(
config.verbose
? new VerboseReporter(config)
: new DefaultReporter()
);

this.addReporter(new SummaryReporter());
}

/**
* Add Custom reporters to Jest
* Custom reporters can be added to Jest using the reporters option in Jest
* Config. The format for adding a custom reporter is following
*
* "reporters": [
* ["reporterPath/packageName", { option1: 'fasklj' }],
* // Format if we want to specify options
*
* "reporterName"
* // Format if we don't want to specify any options
* ]
*/
_addCustomReporters(reporters: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like this method is being called by anything except tests right now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bookman25 Thanks for pointing it out, this will be used by the _setupReporters, based on my conversation with Christop and Dmitrii, I am making a few changes on how the reporters options are passed in the configuration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah. this should be called from the constructor (or setupReporters() method).
i also think it should probably take the entire config as an argument, since it's aware of the configuration and it's better to encapsulate this logic in once place (i mean the logic of where to get the config from and how to validate it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DmitriiAbramov Yes that helps will make this change

let reporterPath, reporterConfig;

reporters.forEach(entry => {
if (Array.isArray(entry)) {
[reporterPath, reporterConfig] = entry;
} else {
if (typeof entry !== 'string') {
throw new Error(`
Unexpected custom reporter configuration.
Expected to get either a path string or an array of [path, confg]
got: ${JSON.stringify(entry)}
`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be quite heavily indented

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I can see this dirsrupting the output badly. Instead of using a Custom Error message, Are there any functions in jest-validate specifically for this purpose?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i actually always use that kind of error messages and i don't mind them being so heavily indented.
maybe we can add a shared utility function that trims indentation to the minimum value of the block?
probably shouldn't be addressed in this PR tho

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can have a function similar to what we are doing with createConfigError maybe. I'll open up another PR for this purpose, after some time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thymikee @DmitriiAbramov Ideally will this be added to jest-validate or I guess Validate can be used here, since it's kind of a validation error.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if we could extend validation possibilities. Right now it's indeed pretty limited.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a module on npm for this purpose called dedent. The code style Jest uses here is to separate multiline strings by using string concatenation. Please follow this style here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpojer Will do that however, it's going to be a temporary fix, as we need this to be in jest-validate ideally.

}

reporterPath = entry;
}

try {
const reporter = require(reporterPath);
this.addReporter(new reporter(reporterConfig || {}));
} catch (error) {
console.error(`
Failed to set up reporter:
${JSON.stringify(reporterPath)}
Config:
${JSON.stringify(reporterConfig)}
`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we print this similarly to how we are already printing warnings/errors, with colors etc? I don't think you need JSON.stringify for the reporterPath, for example.


throw error;
}
});
}

_bailIfNeeded(aggregatedResults: AggregatedResult, watcher: TestWatcher) {
if (this._config.bail && aggregatedResults.numFailedTests !== 0) {
if (watcher.isWatchMode()) {
Expand Down
94 changes: 94 additions & 0 deletions packages/jest-cli/src/__tests__/TestRunner-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,100 @@ test('.addReporter() .removeReporter()', () => {
expect(runner._dispatcher._reporters).not.toContain(reporter);
});

// Checking for the method _addCustomReporters
// Custom reporters used here are the reporters within the package
// No extra reporters are included to be used
describe('_addCustomReporters', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thymikee Hey! I am new to testing. Wrote some unit tests to check the integration. Would you mind giving it a review?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method is prefixed with _ which signifies that it's private. Generally we try to avoid testing private methods (although in rare cases it's necessary).
Instead of writing many unit tests for these modules i'd encourage you to write a few integration tests (you can check jest/integration_tests/ directory to see the examples.

Jest integration tests run Jest agains an existing example directory and verify that stdout/stderr output matches what's expected. They are a little slow and hard to maintain, but they provide much more value and catch more bugs. At the same time you don't have to change anything in your tests when you refactor code, sinc you're not dealing with implementation details.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DmitriiAbramov Thanks a lot that works, based on this I have removed additional tests I added for private method _addCustomReporters and will now add integration tests for custom_reporters separately.

// Paths for the given reporters
const SUMMARY_REPORTER_PATH = './reporters/SummaryReporter.js';
const VERBOSE_REPORTER_PATH = './reporters/VerboseReporter.js';
const DEFAULT_REPORTER_PATH = './reporters/DefaultReporter.js';

// Requiring constructors of the given reporters
// to check against the reporters added
const summaryReporter = require('.' + SUMMARY_REPORTER_PATH);
const verboseReporter = require('.' + VERBOSE_REPORTER_PATH);
const defaultReporter = require('.' + DEFAULT_REPORTER_PATH);

let runner;

beforeEach(() => {
runner = new TestRunner({}, {}, {});

// Removing all the reporters we previously have in the
// Dispatcher. Helps in removing inconsistencies in Tests.
runner._dispatcher._reporters = [];
});

test('adds reporter using 2D Array format', () => {
const reporters = [
[SUMMARY_REPORTER_PATH, {}],
];

expect(runner._dispatcher._reporters).toHaveLength(0);
expect(runner._dispatcher._reporters[0]).toBeUndefined();

runner._addCustomReporters(reporters);

expect(runner._dispatcher._reporters).toHaveLength(1);
expect(runner._dispatcher._reporters.pop()).toBeInstanceOf(summaryReporter);
});

test('adds reporter using 2D syntax with no configuration object', () => {
const reporters = [
[SUMMARY_REPORTER_PATH],
];

runner._addCustomReporters(reporters);

expect(runner._dispatcher._reporters).toHaveLength(1);
expect(runner._dispatcher._reporters.pop()).toBeInstanceOf(SummaryReporter);
});

test('adds reporter using string syntax (no custom configuration)', () => {
const reporters = [
SUMMARY_REPORTER_PATH,
];

runner._addCustomReporters(reporters);

expect(runner._dispatcher._reporters).toHaveLength(1);
expect(runner._dispatcher._reporters.pop()).toBeInstanceOf(summaryReporter);
});

test('adds two reporters with variable format', () => {
const reporters = [
VERBOSE_REPORTER_PATH,
[DEFAULT_REPORTER_PATH, {}],
];
runner._addCustomReporters(reporters);

expect(runner._dispatcher._reporters).toHaveLength(2);

expect(runner._dispatcher._reporters[0]).toBeInstanceOf(verboseReporter);
expect(runner._dispatcher._reporters[1]).toBeInstanceOf(defaultReporter);
});

test('throws on invalid file path', () => {
const reporters = [
['ohthisisnotgoingtobearealpath.sadfslj', {}],
];

const addInvalidReporters = () => {
runner._addCustomReporters(reporters);
};

expect(addInvalidReporters).toThrow();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling this passes the test, but at the same time throws an error too, because of the require calls that are done. Is there any way I can avoid this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can create a mock file and require it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DmitriiAbramov But then the error which is currently thrown won't be thrown. We need to check if the error is thrown. I am doubtful at this point, if really need to test for this, as here we are checking if the require is going to throw invalid error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DmitriiAbramov Sorry! I think this test is way too ambiguous these aren't invalid but non existent reporters. Should be more clearer. Removing this test for now.

Copy link
Contributor Author

@abdulhannanali abdulhannanali Mar 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, I still would like to clarify, if Mock file is going to be helpful in testing for the case where we are checking if file exists or not.

expect(addInvalidReporters).toThrow(/Cannot find module/);
expect(runner._dispatcher._reporters).toHaveLength(0);
});

test('throws on invalid argument to reporter', () => {
expect(() => {
runner._addCustomReporters('This should be an array obviously');
}).toThrow();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should avoid using toThrow, because you can accidentally make a typo in your code and it'll throw with unexpected token or something, but the test will still be green because it still throws an error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

always use a regular expression or a string to match the message

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will add a regular expression, once I can finalize the type of test that's going to be used for this type checking

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for clarifying, I can definitely see what a disaster it can be

});
});

describe('_createInBandTestRun()', () => {
test('injects the rawModuleMap to each the worker in watch mode', () => {
Expand Down
4 changes: 4 additions & 0 deletions packages/jest-config/src/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,15 @@ function normalize(config: InitialConfig, argv: Object = {}) {
case 'moduleLoader':
case 'modulePaths':
case 'name':
case 'noDefaultReporters':
case 'noStackTrace':
case 'notify':
case 'persistModuleRegistryBetweenSpecs':
case 'preset':
case 'replname':
case 'reporters':
value = _replaceRootDirTags(config.rootDir, config[key]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous PR #2115 adds a validation here in order to check the type of the options passed. But after jest-validate that doesn't seem to be necessary.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is necessary, jest-validate only checks for your config to be valid against an example and throws otherwise, it doesn't modify anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thymikee So, If you take a look at the #2115 it adds in a type validation here, which is doing Array.isArray to type check if it's an array, but do we really need that here. As I am getting a ValidationError just based on what's there in validConfig.js.

Here's the ValidationError, I think this error should be suffice. Do we need a custom error here.

 Validation Error:

  Option "reporters" must be of type:
    array
  but instead received:
    string

  Example:
  {
    "reporters": [["./here-it-goes.js", {"option1": true}]]
  }

  Configuration Documentation:
  https://facebook.github.io/jest/docs/configuration.html

break;
case 'resetMocks':
case 'resetModules':
case 'rootDir':
Expand Down
4 changes: 4 additions & 0 deletions packages/jest-config/src/validConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ module.exports = ({
modulePathIgnorePatterns: ['<rootDir>/build/'],
modulePaths: ['/shared/vendor/modules'],
name: 'string',
noDefaultReporters: false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure about this configuration option. Alternatively we could use

reporters: ['summary', 'default'],

which gets overwritten when reporters is specified in a user configuration. However, I also understand that the ergonomics of that aren't great. Instead of a boolean, I'd almost do something like this:

  • reporters – this overwrites the default in Jest.
  • additionalReporters – this just concatenates to the default or the specified reporters config.

Not sure if this is necessarily better and maybe my problem is just with the name of this boolean config, though.

cc @DmitriiAbramov What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i actually think it's a really good idea.
so it will be

"reporters": [
  "default",
  ["custom-jest-reporter-package", {configValue: true}]
}
"additionalReporters": [
  ["custom-jest-reporters-package", {configValue: true}]
]

?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, if the name of the default reporters is simply "default" (instead of "summary, default") then honestly I think we are fine with "reporters" just overwriting the default:

// Includes the default reporters:
reporters: ["default", "custom-reporter"],
// or excludes them:
reporters: ["custom-reporter"],
// or includes some of them:
reporters: ["summary", "custom-reporter"],

This basically would make the default reporter an aggregate of other reporters (jest, summary). We can also change this in the code so that the DefaultReporter wraps the jest (new name for current default reporter?) and summary reporter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpojer I like the style @DmitriiAbramov included for adding the default reporters. I can remove .noDefaultReporters and implement the reporters option first and additionalReporters pretty much going to be based on that so afterwards, even implementing additionalReporters won't be a big problem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Let's start with Dmitrii's suggestion and only implement "reporters" and then see what that looks like and take it from there :)

noStackTrace: false,
notify: false,
preset: 'react-native',
reporters: [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thymikee Would appreciate some feedback from you on this. There was ValidationError being thrown but after a certain number of tries when I added a sample reporters file here, it stopped throwing the error. Shouldn't adding it to types/Config.js be suffice

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, types/Config.js holds types for Flow (which is stripped with babel for runtime). jest-validate checks for actual valid JS object, which in our case is validConfig.js.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool makes sense thanks

['./here-it-goes.js', {option1: true}],
],
resetMocks: false,
resetModules: false,
rootDir: '/',
Expand Down
4 changes: 4 additions & 0 deletions types/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ export type Config = {|
modulePathIgnorePatterns: Array<string>,
modulePaths: Array<string>,
name: string,
noDefaultReporters: boolean,
noStackTrace: boolean,
notify: boolean,
preset: ?string,
reporters: Array<string | Array<string | Object>>,
resetMocks: boolean,
resetModules: boolean,
rootDir: Path,
Expand Down Expand Up @@ -132,6 +134,7 @@ export type InitialConfig = {|
forceExit?: boolean,
globals?: ConfigGlobals,
haste?: HasteConfig,
reporters?: Array<string | Array<string | Object>>,
logHeapUsage?: boolean,
logTransformErrors?: ?boolean,
moduleDirectories?: Array<string>,
Expand All @@ -142,6 +145,7 @@ export type InitialConfig = {|
modulePathIgnorePatterns?: Array<string>,
modulePaths?: Array<string>,
name?: string,
noDefaultReporters?: boolean,
noStackTrace?: boolean,
notify?: boolean,
preprocessorIgnorePatterns?: Array<Glob>,
Expand Down