Skip to content

Commit 7134401

Browse files
jason0x43blakeembrey
authored andcommitted
Only apply exclusion rules when available (#423)
1 parent ece8c23 commit 7134401

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/lib/application.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ export class Application extends ChildableComponent<Application, AbstractCompone
272272
file = Path.resolve(file);
273273
if (FS.statSync(file).isDirectory()) {
274274
add(file);
275-
} else if (exclude && !exclude.match(file)) {
275+
} else if (!exclude || !exclude.match(file)) {
276276
files.push(file);
277277
}
278278
});

test/typedoc.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,34 @@ describe('TypeDoc', function() {
99
it('constructs', function() {
1010
application = new TypeDoc.Application();
1111
});
12-
it('expands input files', function() {
12+
it('expands input directory', function() {
1313
var inputFiles = Path.join(__dirname, 'converter', 'class');
1414
var expanded = application.expandInputFiles([inputFiles]);
1515

1616
Assert.notEqual(expanded.indexOf(Path.join(inputFiles, 'class.ts')), -1);
1717
Assert.equal(expanded.indexOf(inputFiles), -1);
1818
});
19-
it('honors the exclude argument even on a fixed file list', function() {
19+
it('expands input files', function() {
20+
var inputFiles = Path.join(__dirname, 'converter', 'class', 'class.ts');
21+
var expanded = application.expandInputFiles([inputFiles]);
22+
23+
Assert.notEqual(expanded.indexOf(inputFiles), -1);
24+
});
25+
it('honors the exclude argument even on a fixed directory list', function() {
2026
var inputFiles = Path.join(__dirname, 'converter', 'class');
2127
application.options.setValue('exclude', '**/class.ts');
2228
var expanded = application.expandInputFiles([inputFiles]);
2329

2430
Assert.equal(expanded.indexOf(Path.join(inputFiles, 'class.ts')), -1);
2531
Assert.equal(expanded.indexOf(inputFiles), -1);
2632
});
33+
it('honors the exclude argument even on a fixed file list', function() {
34+
var inputFiles = Path.join(__dirname, 'converter', 'class', 'class.ts');
35+
application.options.setValue('exclude', '**/class.ts');
36+
var expanded = application.expandInputFiles([inputFiles]);
37+
38+
Assert.equal(expanded.indexOf(inputFiles), -1);
39+
});
2740
it('supports multiple excludes', function() {
2841
var inputFiles = Path.join(__dirname, 'converter');
2942
application.options.setValue('exclude', '**/+(class|access).ts');

0 commit comments

Comments
 (0)