mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 11:24:49 -05:00
Revert changes to matchFiles/readDirectory made since 4.3 (#46787)
* Revert "Fix RWC missing file detection (#46673)" This reverts commit4a065f524c. * Revert "Pass absolute path to directoryExists (#46086)" This reverts commit55b4928e82. * Revert "Reduce exceptions (#44710)" This reverts commitc0d5c29080. * Add back system watcher limit
This commit is contained in:
@@ -182,34 +182,3 @@ describe("unittests:: Public APIs:: getChild* methods on EndOfFileToken with JSD
|
||||
assert.equal(endOfFileToken.getChildCount(), 1);
|
||||
assert.notEqual(endOfFileToken.getChildAt(0), /*expected*/ undefined);
|
||||
});
|
||||
|
||||
describe("unittests:: Public APIs:: sys", () => {
|
||||
it("readDirectory", () => {
|
||||
// #45990, testing passing a non-absolute path
|
||||
// `sys.readDirectory` is just `matchFiles` plugged into the real FS
|
||||
const read = ts.matchFiles(
|
||||
/*path*/ "",
|
||||
/*extensions*/ [".ts", ".tsx"],
|
||||
/*excludes*/ ["node_modules", "dist"],
|
||||
/*includes*/ ["**/*"],
|
||||
/*useCaseSensitiveFileNames*/ true,
|
||||
/*currentDirectory*/ "/",
|
||||
/*depth*/ undefined,
|
||||
/*getFileSystemEntries*/ path => {
|
||||
switch (path) {
|
||||
case "/": return { directories: [], files: ["file.ts"] };
|
||||
default: return { directories: [], files: [] };
|
||||
}
|
||||
},
|
||||
/*realpath*/ ts.identity,
|
||||
/*directoryExists*/ path => {
|
||||
switch (path) {
|
||||
case "/": return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
assert.deepEqual(read, ["/file.ts"]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user