Fix tests that were failing (#13972)

This commit is contained in:
Andy 2017-01-12 13:28:39 -08:00 committed by GitHub
parent a8dc31d5a2
commit 2273809e3d
23 changed files with 74 additions and 43 deletions

View File

@ -17,21 +17,21 @@ arrayForEach(array, (i: number, index: number, array: Array<number>) => {
const resultThis: Array<{i: number, that: string}> = [];
arrayForEach(array, function(i: number) {
arrayForEach(array, function(i) {
resultThis.push({
i: i,
that: this.that
});
}, { that: 'jeff' });
arrayForEach(array, function(i: number, index: number) {
arrayForEach(array, function(i, index) {
resultThis.push({
i: i + index,
that: this.that
});
}, { that: 'jeff' });
arrayForEach(array, function(i: number, index: number, array: Array<number>) {
arrayForEach(array, function(i, index, array) {
resultThis.push({
i: array[i],
that: this.that

View File

@ -0,0 +1,5 @@
{
"dependencies": {
"moment": ">=2.14.0"
}
}

View File

@ -17,8 +17,5 @@ declare namespace contentDisposition {
export function parse(contentDispositionHeader: string): ContentDisposition;
}
declare function contentDisposition(): string;
declare function contentDisposition(filename: undefined, options: contentDisposition.Options): string;
declare function contentDisposition(filename: string, options?: contentDisposition.Options): string;
declare function contentDisposition(filename?: string, options?: contentDisposition.Options): string;
export = contentDisposition;

View File

@ -53,7 +53,7 @@ declare namespace SQLitePlugin {
readTransaction(fn: TransactionFunction, error?: ErrorCallback, success?: SuccessCallback): void;
executeSql(statement: string, params?: any[], success?: StatementSuccessCallback, error?: ErrorCallback): void;
sqlBatch (sqlStatements: Array<string|[string, any[]]>, success?: SuccessCallback, error?: ErrorCallback): void;
sqlBatch(sqlStatements: Array<string|[string, any[]]>, success?: SuccessCallback, error?: ErrorCallback): void;
close(success?: SuccessCallback, error?: ErrorCallback): void;
}

2
d3-scale/index.d.ts vendored
View File

@ -18,7 +18,7 @@ import { CountableTimeInterval, TimeInterval } from 'd3-time';
* The second generic corresponds to the data type of the return type of the interpolator.
*/
// This is a base interface to be extended, hence the suppression of the warning
// tslint:disable-next-line:functional-interfaces
// tslint:disable-next-line:callable-types
export interface InterpolatorFactory<T, U> {
/**
* Construct a new interpolator function, based on the provided interpolation boundaries.

4
d3-shape/index.d.ts vendored
View File

@ -1610,7 +1610,7 @@ export interface CurveGeneratorLineOnly {
* A factory for curve generators addressing only lines, but not areas.
*/
// This is a base interface to be extended, hence the suppression of the warning
// tslint:disable-next-line:functional-interfaces
// tslint:disable-next-line:callable-types
export interface CurveFactoryLineOnly {
/**
* Returns a "lines only" curve generator which renders to the specified context.
@ -1646,7 +1646,7 @@ export interface CurveGenerator extends CurveGeneratorLineOnly {
* A factory for curve generators addressing both lines and areas.
*/
// This is a base interface to be extended, hence the suppression of the warning
// tslint:disable-next-line:functional-interfaces
// tslint:disable-next-line:callable-types
export interface CurveFactory {
/**
* Returns a curve generator which renders to the specified context.

View File

@ -7073,7 +7073,7 @@ namespace TestIsError {
let result: CustomError = value;
}
else {
let result: number = value;
let result: number = value as number;
}
}

View File

@ -63,7 +63,7 @@ function makeRequest() {
} else {
details.displayItems.splice(1, 1, shippingOption);
}
details.shippingOptions = [shippingOption];
} else {
details.shippingOptions = [];
@ -76,7 +76,7 @@ function makeRequest() {
}
async function processPayment(): Promise<PaymentResponse> {
let paymentResponse;
let paymentResponse: PaymentResponse;
try {
paymentResponse = await makeRequest()
} catch (error) {

3
plugapi/index.d.ts vendored
View File

@ -357,8 +357,7 @@ declare namespace PlugAPI {
}
declare class PlugAPI {
constructor(login: PlugAPI.PlugLogin, callback?: (error: Error, bot: PlugAPI) => void);
constructor(login: PlugAPI.PlugLogin, callback?: (bot: PlugAPI) => void);
constructor(login: PlugAPI.PlugLogin, callback?: (error: Error, bot: PlugAPI) => void | ((bot: PlugAPI) => void));
deleteAllChat: boolean;
multiLine: boolean;
multiLineLimit: number;

View File

@ -4,21 +4,21 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface RandomSeed {
range (range: number): number;
random (): number;
floatBetween (min: number, max: number): number;
intBetween (min: number, max: number): number;
range(range: number): number;
random(): number;
floatBetween(min: number, max: number): number;
intBetween(min: number, max: number): number;
string (count: number): string;
seed (seed: string): void;
string(count: number): string;
seed(seed: string): void;
cleanString (inStr: string): string;
hashString (inStr: string): string;
cleanString(inStr: string): string;
hashString(inStr: string): string;
addEntropy (...args: any[]): void;
initState (): void;
addEntropy(...args: any[]): void;
initState(): void;
done (): void;
done(): void;
}
export function create (seed?: string): RandomSeed;
export function create(seed?: string): RandomSeed;

View File

@ -0,0 +1,5 @@
{
"dependencies": {
"redux": "^3.6.0"
}
}

View File

@ -0,0 +1,5 @@
{
"dependencies": {
"redux": "^3.6.0"
}
}

View File

@ -0,0 +1,5 @@
{
"dependencies": {
"redux": "^3.6.0"
}
}

View File

@ -5,5 +5,5 @@
import { StorageAdapter } from "redux-localstorage";
export function getSubset (obj: any, paths: string[]): any;
export default function filter (paths?: string | string[]): <A>(adapter: StorageAdapter<A>) => StorageAdapter<A>;
export function getSubset(obj: any, paths: string[]): any;
export default function filter(paths?: string | string[]): <A>(adapter: StorageAdapter<A>) => StorageAdapter<A>;

View File

@ -22,8 +22,8 @@ export type StorageAdapterCreator<A> = (storage: A) => StorageAdapter<A>;
export interface StorageAdapterEnhancer {}
export function mergePersistedState (merge?: <A1, A2>(initialState: A1, persistentState: A2) => A1 & A2): <A>(next: Redux.Reducer<A>) => Redux.Reducer<A>;
export function mergePersistedState(merge?: <A1, A2>(initialState: A1, persistentState: A2) => A1 & A2): <A>(next: Redux.Reducer<A>) => Redux.Reducer<A>;
export default function persistState<A> (storage?: StorageAdapter<A>, key?: string, callback?: Function): Redux.GenericStoreEnhancer;
export default function persistState<A>(storage?: StorageAdapter<A>, key?: string, callback?: Function): Redux.GenericStoreEnhancer;
export const actionTypes: ActionTypes;

View File

@ -0,0 +1,5 @@
{
"dependencies": {
"redux": "^3.6.0"
}
}

View File

@ -0,0 +1,5 @@
{
"dependencies": {
"redux": "^3.6.0"
}
}

5
redux-ui/package.json Normal file
View File

@ -0,0 +1,5 @@
{
"dependencies": {
"redux": "^3.6.0"
}
}

View File

@ -4,7 +4,7 @@
"target": "es6",
"noImplicitAny": true,
"noImplicitThis": false,
"strictNullChecks": true,
"strictNullChecks": false,
"baseUrl": "../../",
"typeRoots": [
"../../"

6
table/index.d.ts vendored
View File

@ -44,8 +44,8 @@ export interface TableUserConfig {
columnDefault?: ColumnConfig;
}
export function table (data: any[], userConfig?: TableUserConfig): string;
export function table(data: any[], userConfig?: TableUserConfig): string;
export function createStream (userConfig: TableUserConfig): { write: string[] };
export function createStream(userConfig: TableUserConfig): { write: string[] };
export function getBorderCharacters (templateName: borderType): JoinStruct;
export function getBorderCharacters(templateName: borderType): JoinStruct;

View File

@ -0,0 +1,5 @@
{
"dependencies": {
"immutable": "^3.8.1"
}
}

3
verror/index.d.ts vendored
View File

@ -26,8 +26,7 @@ declare class VError extends Error {
static fullStack(err: Error): string;
cause(): Error | undefined;
constructor(options: VError.Options, message: string, ...params: any[]);
constructor(cause: Error, message: string, ...params: any[]);
constructor(options: VError.Options | Error, message: string, ...params: any[]);
constructor(message: string, ...params: any[]);
}

View File

@ -223,13 +223,9 @@ type CredentialBodyType = FormData|URLSearchParams;
declare class PasswordCredential extends SiteBoundCredential {
/**
* @see {@link https://www.w3.org/TR/credential-management-1/#dom-passwordcredential-passwordcredential-data}
*/
constructor(data: PasswordCredentialData);
/**
* @see {@link https://www.w3.org/TR/credential-management-1/#dom-passwordcredential-passwordcredential}
*/
constructor(form: HTMLFormElement);
constructor(data: PasswordCredentialData | HTMLFormElement);
readonly type: 'password';