Skip to content

Commit e036dc2

Browse files
aitheriosfkling
authored andcommitted
Add __mocks__ folder to default ignoreDir (#135)
As __mocks__ is used in manual mocks on jest cf. https://facebook.github.io/jest/docs/manual-mocks.html
1 parent 6f73686 commit e036dc2

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Options:
3434
--pretty pretty print JSON
3535
-x, --extension File extensions to consider. Repeat to define multiple extensions. Default: [js,jsx]
3636
-e, --exclude Filename pattern to exclude. Default: []
37-
-i, --ignore Folders to ignore. Default: [node_modules,__tests__]
37+
-i, --ignore Folders to ignore. Default: [node_modules,__tests__,__mocks__]
3838
--resolver RESOLVER Resolver name (findAllComponentDefinitions, findExportedComponentDefinition) or
3939
path to a module that exports a resolver. [findExportedComponentDefinition]
4040

bin/__tests__/react-docgen-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ describe('react-docgen CLI', () => {
153153
]);
154154
}, TEST_TIMEOUT);
155155

156-
it('ignores files in node_modules and __tests__ by default', () => {
156+
it('ignores files in node_modules, __tests__ and __mocks__ by default', () => {
157157
createTempfiles(null, 'node_modules');
158158
createTempfiles(null, '__tests__');
159+
createTempfiles(null, '__mocks__');
159160

160161
return run([tempDir]).then(([stdout, stderr]) => {
161162
expect(stdout).toBe('');

bin/react-docgen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var argv = require('nomnom')
4949
full: 'ignore',
5050
help: 'Folders to ignore. Default:',
5151
list: true,
52-
default: ['node_modules', '__tests__'],
52+
default: ['node_modules', '__tests__', '__mocks__'],
5353
},
5454
resolver: {
5555
help: 'Resolver name (findAllComponentDefinitions, findExportedComponentDefinition) or path to a module that exports a resolver.',

0 commit comments

Comments
 (0)