mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
Complicate the paths of the project for better sourcemap testing
This commit is contained in:
@@ -239,13 +239,23 @@ namespace ts {
|
||||
builder.buildAllProjects();
|
||||
assertDiagnosticMessages(/*none*/);
|
||||
|
||||
it("Generates files matching the baseline", () => {
|
||||
Harness.Baseline.runBaseline("outfile-concat.js", () => {
|
||||
return fs.readFileSync("/src/third/third-output.js", 'utf-8');
|
||||
const files = [
|
||||
"/src/third/thirdjs/output/third-output.js",
|
||||
"/src/third/thirdjs/output/third-output.js.map"
|
||||
];
|
||||
|
||||
|
||||
for (const file of files) {
|
||||
it(`Generates files matching the baseline - ${file}`, () => {
|
||||
Harness.Baseline.runBaseline(getBaseFileName(file), () => {
|
||||
return fs.readFileSync(file, 'utf-8');
|
||||
});
|
||||
});
|
||||
|
||||
Harness.Baseline.runBaseline("outfile-concat.js.map", () => {
|
||||
return fs.readFileSync("/src/third/third-output.js.map", 'utf-8');
|
||||
}
|
||||
|
||||
it(`Generates files matching the baseline - file listing for outFile-concat`, () => {
|
||||
Harness.Baseline.runBaseline("outfile-concat-fileListing.txt", () => {
|
||||
return fs.getFileListing();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -353,10 +353,7 @@ namespace vfs {
|
||||
if (!result.node) this._mkdir(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Print diagnostic information about the structure of the file system to the console.
|
||||
*/
|
||||
public debugPrint(): void {
|
||||
public getFileListing(): string {
|
||||
let result = "";
|
||||
const printLinks = (dirname: string | undefined, links: collections.SortedMap<string, Inode>) => {
|
||||
const iterator = collections.getIterator(links);
|
||||
@@ -384,7 +381,14 @@ namespace vfs {
|
||||
}
|
||||
};
|
||||
printLinks(/*dirname*/ undefined, this._getRootLinks());
|
||||
console.log(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print diagnostic information about the structure of the file system to the console.
|
||||
*/
|
||||
public debugPrint(): void {
|
||||
console.log(this.getFileListing());
|
||||
}
|
||||
|
||||
// POSIX API (aligns with NodeJS "fs" module API)
|
||||
|
||||
Reference in New Issue
Block a user