fix: Update test code to type-check under TS 2.5 (#20175)

PR Close #20175
This commit is contained in:
Alex Eagle
2017-11-15 08:43:35 -08:00
committed by Miško Hevery
parent c2a24b4241
commit 5ec1717c58
19 changed files with 55 additions and 48 deletions

View File

@ -27,7 +27,7 @@ describe('metadata bundler', () => {
const originalOne = './src/one';
const originalTwo = './src/two/index';
expect(Object.keys(result.metadata.origins)
expect(Object.keys(result.metadata.origins !)
.sort()
.map(name => ({name, value: result.metadata.origins ![name]})))
.toEqual([

View File

@ -102,6 +102,7 @@ export class MockNode implements ts.Node {
export class MockIdentifier extends MockNode implements ts.Identifier {
public text: string;
public escapedText: ts.__String;
// tslint:disable
public _primaryExpressionBrand: any;
public _memberExpressionBrand: any;
@ -137,12 +138,14 @@ export class MockVariableDeclaration extends MockNode implements ts.VariableDecl
}
export class MockSymbol implements ts.Symbol {
public escapedName: ts.__String;
constructor(
public name: string, private node: ts.Declaration = MockVariableDeclaration.of(name),
public flags: ts.SymbolFlags = 0) {}
getFlags(): ts.SymbolFlags { return this.flags; }
getName(): string { return this.name; }
getEscapedName(): ts.__String { return this.escapedName; }
getDeclarations(): ts.Declaration[] { return [this.node]; }
getDocumentationComment(): ts.SymbolDisplayPart[] { return []; }
// TODO(vicb): removed in TS 2.2