From 2273809e3d6c4cb668c8a0b86d854fc04a08e66e Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 12 Jan 2017 13:28:39 -0800 Subject: [PATCH] Fix tests that were failing (#13972) --- array-foreach/array-foreach-tests.ts | 6 ++--- bootstrap.v3.datetimepicker/v3/package.json | 5 ++++ content-disposition/index.d.ts | 5 +--- cordova-sqlite-storage/index.d.ts | 2 +- d3-scale/index.d.ts | 2 +- d3-shape/index.d.ts | 4 ++-- lodash/v3/lodash-tests.ts | 2 +- paymentrequest/paymentrequest-tests.ts | 4 ++-- plugapi/index.d.ts | 3 +-- random-seed/index.d.ts | 24 ++++++++++---------- redux-action-utils/package.json | 5 ++++ redux-immutable-state-invariant/package.json | 5 ++++ redux-immutable/package.json | 5 ++++ redux-localstorage-filter/index.d.ts | 4 ++-- redux-localstorage/index.d.ts | 4 ++-- redux-logger/package.json | 5 ++++ redux-promise/package.json | 5 ++++ redux-ui/package.json | 5 ++++ sequelize/v3/tsconfig.json | 2 +- table/index.d.ts | 6 ++--- transducers-js/package.json | 5 ++++ verror/index.d.ts | 3 +-- webappsec-credential-management/index.d.ts | 6 +---- 23 files changed, 74 insertions(+), 43 deletions(-) create mode 100644 bootstrap.v3.datetimepicker/v3/package.json create mode 100644 redux-action-utils/package.json create mode 100644 redux-immutable-state-invariant/package.json create mode 100644 redux-immutable/package.json create mode 100644 redux-logger/package.json create mode 100644 redux-promise/package.json create mode 100644 redux-ui/package.json create mode 100644 transducers-js/package.json diff --git a/array-foreach/array-foreach-tests.ts b/array-foreach/array-foreach-tests.ts index 02c1d2dadd..9cb300f234 100644 --- a/array-foreach/array-foreach-tests.ts +++ b/array-foreach/array-foreach-tests.ts @@ -17,21 +17,21 @@ arrayForEach(array, (i: number, index: number, array: Array) => { 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) { +arrayForEach(array, function(i, index, array) { resultThis.push({ i: array[i], that: this.that diff --git a/bootstrap.v3.datetimepicker/v3/package.json b/bootstrap.v3.datetimepicker/v3/package.json new file mode 100644 index 0000000000..4c6d24a445 --- /dev/null +++ b/bootstrap.v3.datetimepicker/v3/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "moment": ">=2.14.0" + } +} \ No newline at end of file diff --git a/content-disposition/index.d.ts b/content-disposition/index.d.ts index 56ea66f8ca..4d0bbd8d94 100644 --- a/content-disposition/index.d.ts +++ b/content-disposition/index.d.ts @@ -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; diff --git a/cordova-sqlite-storage/index.d.ts b/cordova-sqlite-storage/index.d.ts index 4c155d80e6..76e3aac5a3 100644 --- a/cordova-sqlite-storage/index.d.ts +++ b/cordova-sqlite-storage/index.d.ts @@ -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, success?: SuccessCallback, error?: ErrorCallback): void; + sqlBatch(sqlStatements: Array, success?: SuccessCallback, error?: ErrorCallback): void; close(success?: SuccessCallback, error?: ErrorCallback): void; } diff --git a/d3-scale/index.d.ts b/d3-scale/index.d.ts index c1c6e5eb8a..2fe664346a 100644 --- a/d3-scale/index.d.ts +++ b/d3-scale/index.d.ts @@ -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 { /** * Construct a new interpolator function, based on the provided interpolation boundaries. diff --git a/d3-shape/index.d.ts b/d3-shape/index.d.ts index 9245bca54c..3292eae937 100644 --- a/d3-shape/index.d.ts +++ b/d3-shape/index.d.ts @@ -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. diff --git a/lodash/v3/lodash-tests.ts b/lodash/v3/lodash-tests.ts index 8ce09add75..8793d38779 100644 --- a/lodash/v3/lodash-tests.ts +++ b/lodash/v3/lodash-tests.ts @@ -7073,7 +7073,7 @@ namespace TestIsError { let result: CustomError = value; } else { - let result: number = value; + let result: number = value as number; } } diff --git a/paymentrequest/paymentrequest-tests.ts b/paymentrequest/paymentrequest-tests.ts index 2297d30a71..4c36c3ff76 100644 --- a/paymentrequest/paymentrequest-tests.ts +++ b/paymentrequest/paymentrequest-tests.ts @@ -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 { - let paymentResponse; + let paymentResponse: PaymentResponse; try { paymentResponse = await makeRequest() } catch (error) { diff --git a/plugapi/index.d.ts b/plugapi/index.d.ts index 4a2acd9e22..82782a1934 100644 --- a/plugapi/index.d.ts +++ b/plugapi/index.d.ts @@ -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; diff --git a/random-seed/index.d.ts b/random-seed/index.d.ts index b0990bb805..d90016b83d 100644 --- a/random-seed/index.d.ts +++ b/random-seed/index.d.ts @@ -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; diff --git a/redux-action-utils/package.json b/redux-action-utils/package.json new file mode 100644 index 0000000000..e52256ea90 --- /dev/null +++ b/redux-action-utils/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} \ No newline at end of file diff --git a/redux-immutable-state-invariant/package.json b/redux-immutable-state-invariant/package.json new file mode 100644 index 0000000000..e52256ea90 --- /dev/null +++ b/redux-immutable-state-invariant/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} \ No newline at end of file diff --git a/redux-immutable/package.json b/redux-immutable/package.json new file mode 100644 index 0000000000..e52256ea90 --- /dev/null +++ b/redux-immutable/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} \ No newline at end of file diff --git a/redux-localstorage-filter/index.d.ts b/redux-localstorage-filter/index.d.ts index 17a0c376ff..1a92887a8c 100644 --- a/redux-localstorage-filter/index.d.ts +++ b/redux-localstorage-filter/index.d.ts @@ -5,5 +5,5 @@ import { StorageAdapter } from "redux-localstorage"; -export function getSubset (obj: any, paths: string[]): any; -export default function filter (paths?: string | string[]): (adapter: StorageAdapter) => StorageAdapter; +export function getSubset(obj: any, paths: string[]): any; +export default function filter(paths?: string | string[]): (adapter: StorageAdapter) => StorageAdapter; diff --git a/redux-localstorage/index.d.ts b/redux-localstorage/index.d.ts index b0922a9279..b4af824d9b 100644 --- a/redux-localstorage/index.d.ts +++ b/redux-localstorage/index.d.ts @@ -22,8 +22,8 @@ export type StorageAdapterCreator = (storage: A) => StorageAdapter; export interface StorageAdapterEnhancer {} -export function mergePersistedState (merge?: (initialState: A1, persistentState: A2) => A1 & A2): (next: Redux.Reducer) => Redux.Reducer; +export function mergePersistedState(merge?: (initialState: A1, persistentState: A2) => A1 & A2): (next: Redux.Reducer) => Redux.Reducer; -export default function persistState (storage?: StorageAdapter, key?: string, callback?: Function): Redux.GenericStoreEnhancer; +export default function persistState(storage?: StorageAdapter, key?: string, callback?: Function): Redux.GenericStoreEnhancer; export const actionTypes: ActionTypes; diff --git a/redux-logger/package.json b/redux-logger/package.json new file mode 100644 index 0000000000..e52256ea90 --- /dev/null +++ b/redux-logger/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} \ No newline at end of file diff --git a/redux-promise/package.json b/redux-promise/package.json new file mode 100644 index 0000000000..e52256ea90 --- /dev/null +++ b/redux-promise/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} \ No newline at end of file diff --git a/redux-ui/package.json b/redux-ui/package.json new file mode 100644 index 0000000000..e52256ea90 --- /dev/null +++ b/redux-ui/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} \ No newline at end of file diff --git a/sequelize/v3/tsconfig.json b/sequelize/v3/tsconfig.json index e8cf1d1f3f..60b0b8a536 100644 --- a/sequelize/v3/tsconfig.json +++ b/sequelize/v3/tsconfig.json @@ -4,7 +4,7 @@ "target": "es6", "noImplicitAny": true, "noImplicitThis": false, - "strictNullChecks": true, + "strictNullChecks": false, "baseUrl": "../../", "typeRoots": [ "../../" diff --git a/table/index.d.ts b/table/index.d.ts index 7e0cb1d41a..b5beffb524 100644 --- a/table/index.d.ts +++ b/table/index.d.ts @@ -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; diff --git a/transducers-js/package.json b/transducers-js/package.json new file mode 100644 index 0000000000..84d23a146b --- /dev/null +++ b/transducers-js/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "immutable": "^3.8.1" + } +} \ No newline at end of file diff --git a/verror/index.d.ts b/verror/index.d.ts index 63c68fd7f9..78bd4920f6 100644 --- a/verror/index.d.ts +++ b/verror/index.d.ts @@ -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[]); } diff --git a/webappsec-credential-management/index.d.ts b/webappsec-credential-management/index.d.ts index faca7ed46f..0c1c2b5e2d 100644 --- a/webappsec-credential-management/index.d.ts +++ b/webappsec-credential-management/index.d.ts @@ -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';