add unit tests
This commit is contained in:
parent
9c92ec3a55
commit
6cc1ff102e
|
@ -170,5 +170,36 @@ namespace ts {
|
||||||
["/apath/.git/a.ts", "/apath/.b.ts", "/apath/..c.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"]
|
||||||
|
)
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue