From 6cc1ff102ee3f7ba183f1dd934cd173b93077697 Mon Sep 17 00:00:00 2001 From: zhengbli Date: Thu, 19 May 2016 17:26:12 -0700 Subject: [PATCH] add unit tests --- tests/cases/unittests/tsconfigParsing.ts | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/cases/unittests/tsconfigParsing.ts b/tests/cases/unittests/tsconfigParsing.ts index ec025e0b210..776d9495e87 100644 --- a/tests/cases/unittests/tsconfigParsing.ts +++ b/tests/cases/unittests/tsconfigParsing.ts @@ -170,5 +170,36 @@ namespace ts { ["/apath/.git/a.ts", "/apath/.b.ts", "/apath/..c.ts"] ) }); + + it("always exclude outDir", () => { + const tsconfigWithoutExclude = + `{ + "compilerOptions": { + "outDir": "bin" + } + }`; + const tsconfigWithExclude = + `{ + "compilerOptions": { + "outDir": "bin" + }, + "exclude": [ "obj" ] + }`; + const rootDir = "/"; + const allFiles = ["/bin/a.ts", "/b.ts"]; + const expectedFiles = ["/b.ts"]; + assertParseFileList(tsconfigWithoutExclude, "tsconfig.json", rootDir, allFiles, expectedFiles); + assertParseFileList(tsconfigWithExclude, "tsconfig.json", rootDir, allFiles, expectedFiles); + }) + + it("implicitly exclude common package folders", () => { + assertParseFileList( + `{}`, + "tsconfig.json", + "/", + ["/node_modules/a.ts", "/bower_components/b.ts", "/jspm_packages/c.ts", "/d.ts", "/folder/e.ts"], + ["/d.ts", "/folder/e.ts"] + ) + }) }); }