Fix linter errors

This commit is contained in:
Lukas Zech
2017-02-26 12:29:39 +01:00
parent d668bf8cf3
commit 5d864d9772
3 changed files with 219 additions and 223 deletions
+14 -20
View File
@@ -70,7 +70,7 @@ declare namespace jasmine {
function stringMatching(str: string): Any;
function stringMatching(str: RegExp): Any;
function formatErrorMsg(domain: string, usage: string): (msg: string) => string
function formatErrorMsg(domain: string, usage: string): (msg: string) => string;
interface Any {
@@ -124,18 +124,14 @@ declare namespace jasmine {
withMock(func: () => void): void;
}
interface CustomEqualityTester {
(first: any, second: any): boolean;
}
type CustomEqualityTester = (first: any, second: any) => boolean;
interface CustomMatcher {
compare<T>(actual: T, expected: T): CustomMatcherResult;
compare(actual: any, expected: any): CustomMatcherResult;
}
interface CustomMatcherFactory {
(util: MatchersUtil, customEqualityTesters: Array<CustomEqualityTester>): CustomMatcher;
}
type CustomMatcherFactory = (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]) => CustomMatcher;
interface CustomMatcherFactories {
[index: string]: CustomMatcherFactory;
@@ -147,9 +143,9 @@ declare namespace jasmine {
}
interface MatchersUtil {
equals(a: any, b: any, customTesters?: Array<CustomEqualityTester>): boolean;
contains<T>(haystack: ArrayLike<T> | string, needle: any, customTesters?: Array<CustomEqualityTester>): boolean;
buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array<any>): string;
equals(a: any, b: any, customTesters?: CustomEqualityTester[]): boolean;
contains<T>(haystack: ArrayLike<T> | string, needle: any, customTesters?: CustomEqualityTester[]): boolean;
buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: any[]): string;
}
interface Env {
@@ -390,18 +386,18 @@ declare namespace jasmine {
}
interface CustomReporterResult {
description: string,
failedExpectations?: FailedExpectation[],
fullName: string,
description: string;
failedExpectations?: FailedExpectation[];
fullName: string;
id: string;
passedExpectations?: PassedExpectation[],
passedExpectations?: PassedExpectation[];
pendingReason?: string;
status?: string;
}
interface RunDetails {
failedExpectations: ExpectationResult[];
order: jasmine.Order
order: jasmine.Order;
}
interface CustomReporter {
@@ -431,9 +427,7 @@ declare namespace jasmine {
results(): NestedResults;
}
interface SpecFunction {
(spec?: Spec): void;
}
type SpecFunction = (spec?: Spec) => void;
interface SuiteOrSpec {
id: number;
@@ -513,7 +507,7 @@ declare namespace jasmine {
identity: string;
and: SpyAnd;
calls: Calls;
mostRecentCall: {args: any[];};
mostRecentCall: {args: any[]; };
argsForCall: any[];
}
@@ -574,7 +568,7 @@ declare namespace jasmine {
finished: boolean;
result: any;
messages: any;
runDetails: RunDetails
runDetails: RunDetails;
new (): any;
+194 -192
View File
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -60,7 +60,7 @@ describe("Included matchers:", () => {
foo: 'foo'
};
expect(a.foo).toBeDefined();
expect((<any>a).bar).not.toBeDefined();
expect((a as any).bar).not.toBeDefined();
});
it("The `toBeUndefined` matcher compares against `undefined`", () => {
@@ -68,7 +68,7 @@ describe("Included matchers:", () => {
foo: 'foo'
};
expect(a.foo).not.toBeUndefined();
expect((<any>a).bar).toBeUndefined();
expect((a as any).bar).toBeUndefined();
});
it("The 'toBeNull' matcher compares against null", () => {
@@ -202,7 +202,7 @@ describe("A spy", () => {
var foo: any, bar: any = null;
beforeEach(() => {
foo = {
setBar: function (value: any) {
setBar: (value: any) => {
bar = value;
}
};
@@ -235,7 +235,7 @@ describe("A spy, when configured to call through", () => {
var foo: any, bar: any, fetchedBar: any;
beforeEach(() => {
foo = {
setBar: function (value: any) {
setBar: (value: any) => {
bar = value;
},
getBar: () => {
@@ -261,7 +261,7 @@ describe("A spy, when faking a return value", () => {
var foo: any, bar: any, fetchedBar: any;
beforeEach(() => {
foo = {
setBar: function (value: any) {
setBar: (value: any) => {
bar = value;
},
getBar: () => {
@@ -287,7 +287,7 @@ describe("A spy, when faking a return value", () => {
var foo: any, bar: any, fetchedBar: any;
beforeEach(() => {
foo = {
setBar: function (value: any) {
setBar: (value: any) => {
bar = value;
},
getBar: () => {
@@ -319,7 +319,7 @@ describe("A spy, when created manually", () => {
whatAmI("I", "am", "a", "spy");
});
it("is named, which helps in error reporting", () => {
expect(whatAmI.identity).toEqual('whatAmI')
expect(whatAmI.identity).toEqual('whatAmI');
});
it("tracks that the spy was called", () => {
expect(whatAmI).toHaveBeenCalled();
@@ -369,7 +369,7 @@ describe("jasmine.any", () => {
it("is useful for comparing arguments", () => {
var foo = jasmine.createSpy('foo');
foo(12, () => {
return true
return true;
});
expect(foo).toHaveBeenCalledWith(jasmine.any(Number), jasmine.any(Function));
});
@@ -430,7 +430,7 @@ describe("Asynchronous specs", () => {
jasmineEnv.updateInterval = 250;
var htmlReporter = new jasmine.HtmlReporter();
jasmineEnv.addReporter(htmlReporter);
jasmineEnv.specFilter = function (spec) {
jasmineEnv.specFilter = (spec) => {
return htmlReporter.specFilter(spec);
};
var currentWindowOnload = (arg: any) => window.onload(arg);
@@ -439,11 +439,11 @@ describe("Asynchronous specs", () => {
currentWindowOnload(null);
}
(<HTMLElement>document.querySelector('.version')).innerHTML = jasmineEnv.versionString();
(document.querySelector('.version') as HTMLElement).innerHTML = jasmineEnv.versionString();
execJasmine();
};
function execJasmine() {
jasmineEnv.execute();
}
})();
})();