chore(build): fix formatting and tests

Closes #8098
This commit is contained in:
Alex Eagle
2016-04-28 21:58:51 -07:00
committed by Tobias Bosch
parent 78946fe9fa
commit 96ae348648
9 changed files with 20 additions and 24 deletions

View File

@ -234,13 +234,13 @@ export function main() {
});
it('should simplify a module reference across modules', () => {
expect(crossModuleSimplify({moduleId: '', filePath: '/src/cases'},
expect(crossModuleSimplify(new ModuleContext('', '/src/cases'),
({__symbolic: "reference", module: "./extern", name: "s"})))
.toEqual("s");
});
it('should simplify a module reference without crossing modules', () => {
expect(singleModuleSimplify({moduleId: '', filePath: '/src/cases'},
expect(singleModuleSimplify(new ModuleContext('', '/src/cases'),
({__symbolic: "reference", module: "./extern", name: "s"})))
.toEqual(host.getStaticSymbol('', '/src/extern.d.ts', 's'));
});
@ -261,7 +261,7 @@ class MockReflectorHost implements StaticReflectorHost {
}
// In tests, assume that symbols are not re-exported
findDeclaration(modulePath: string, symbolName: string, containingFile: string): StaticSymbol {
findDeclaration(modulePath: string, symbolName: string, containingFile?: string): StaticSymbol {
function splitPath(path: string): string[] { return path.split(/\/|\\/g); }
function resolvePath(pathParts: string[]): string {
@ -294,7 +294,7 @@ class MockReflectorHost implements StaticReflectorHost {
if (modulePath.indexOf('.') === 0) {
return this.getStaticSymbol(`mod/${symbolName}`, pathTo(containingFile, modulePath) + '.d.ts',
symbolName);
symbolName);
}
return this.getStaticSymbol(`mod/${symbolName}`, '/tmp/' + modulePath + '.d.ts', symbolName);
}