chore(tests): enable lint, make it green. (#10224)

This commit is contained in:
Victor Berchet
2016-07-21 17:12:00 -07:00
committed by GitHub
parent 27b87ef535
commit 00aa7a76b6
106 changed files with 1599 additions and 1634 deletions

View File

@ -8,7 +8,7 @@
import * as ts from 'typescript';
import {ReflectorHost, ReflectorHostContext} from '../src/reflector_host';
import {ReflectorHostContext} from '../src/reflector_host';
export type Entry = string | Directory;
@ -19,7 +19,7 @@ export class MockContext implements ReflectorHostContext {
fileExists(fileName: string): boolean { return typeof this.getEntry(fileName) === 'string'; }
directoryExists(path: string): boolean { return typeof this.getEntry(path) === 'object' }
directoryExists(path: string): boolean { return typeof this.getEntry(path) === 'object'; }
readFile(fileName: string): string|undefined {
let data = this.getEntry(fileName);

View File

@ -21,7 +21,7 @@ describe('reflector_host', () => {
beforeEach(() => {
context = new MockContext('/tmp/src', clone(FILES));
host = new MockCompilerHost(context)
host = new MockCompilerHost(context);
program = ts.createProgram(
['main.ts'], {
module: ts.ModuleKind.CommonJS,
@ -93,10 +93,10 @@ describe('reflector_host', () => {
expect(reflectorHost.getStaticSymbol('angularjs', 'SomeAngularSymbol')).toBeDefined();
});
it('should be able to read a metadata file',
() => {
expect(reflectorHost.getMetadataFor('node_modules/@angular/core.d.ts'))
.toEqual({__symbolic: 'module', version: 1, metadata: {foo: {__symbolic: 'class'}}})});
it('should be able to read a metadata file', () => {
expect(reflectorHost.getMetadataFor('node_modules/@angular/core.d.ts'))
.toEqual({__symbolic: 'module', version: 1, metadata: {foo: {__symbolic: 'class'}}});
});
it('should be able to read metadata from an otherwise unused .d.ts file ', () => {
expect(reflectorHost.getMetadataFor('node_modules/@angular/unused.d.ts')).toBeUndefined();
@ -107,7 +107,8 @@ describe('reflector_host', () => {
});
});
const dummyModule = 'export let foo: any[];'
const dummyModule = 'export let foo: any[];';
const FILES: Entry = {
'tmp': {
'src': {
@ -134,7 +135,7 @@ const FILES: Entry = {
}
}
}
}
};
function clone(entry: Entry): Entry {
if (typeof entry === 'string') {