Skip to content

Commit 6cc1ff1

Browse files
committed
add unit tests
1 parent 9c92ec3 commit 6cc1ff1

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/cases/unittests/tsconfigParsing.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,36 @@ namespace ts {
170170
["/apath/.git/a.ts", "/apath/.b.ts", "/apath/..c.ts"]
171171
)
172172
});
173+
174+
it("always exclude outDir", () => {
175+
const tsconfigWithoutExclude =
176+
`{
177+
"compilerOptions": {
178+
"outDir": "bin"
179+
}
180+
}`;
181+
const tsconfigWithExclude =
182+
`{
183+
"compilerOptions": {
184+
"outDir": "bin"
185+
},
186+
"exclude": [ "obj" ]
187+
}`;
188+
const rootDir = "/";
189+
const allFiles = ["/bin/a.ts", "/b.ts"];
190+
const expectedFiles = ["/b.ts"];
191+
assertParseFileList(tsconfigWithoutExclude, "tsconfig.json", rootDir, allFiles, expectedFiles);
192+
assertParseFileList(tsconfigWithExclude, "tsconfig.json", rootDir, allFiles, expectedFiles);
193+
})
194+
195+
it("implicitly exclude common package folders", () => {
196+
assertParseFileList(
197+
`{}`,
198+
"tsconfig.json",
199+
"/",
200+
["/node_modules/a.ts", "/bower_components/b.ts", "/jspm_packages/c.ts", "/d.ts", "/folder/e.ts"],
201+
["/d.ts", "/folder/e.ts"]
202+
)
203+
})
173204
});
174205
}

0 commit comments

Comments
 (0)