From 94fda366f42b0dccf2703579ffff0e2b5e4a065a Mon Sep 17 00:00:00 2001 From: Kuniwak Date: Mon, 24 Aug 2015 19:51:24 +0900 Subject: [PATCH 1/3] Assertions should return Thenable --- .../chai-as-promised-tests-with-bluebird.ts | 7 + .../chai-as-promised-tests-with-q.ts | 7 + chai-as-promised/chai-as-promised-tests.ts | 58 +++- chai-as-promised/chai-as-promised.d.ts | 283 +++++++++++++++++- 4 files changed, 326 insertions(+), 29 deletions(-) create mode 100644 chai-as-promised/chai-as-promised-tests-with-bluebird.ts create mode 100644 chai-as-promised/chai-as-promised-tests-with-q.ts diff --git a/chai-as-promised/chai-as-promised-tests-with-bluebird.ts b/chai-as-promised/chai-as-promised-tests-with-bluebird.ts new file mode 100644 index 0000000000..e27205c41b --- /dev/null +++ b/chai-as-promised/chai-as-promised-tests-with-bluebird.ts @@ -0,0 +1,7 @@ +/// +/// + +// Compatibility check for Promise/A+ valid libraries +var thenableNum: Chai.Thenable; +import Bluebird = require('bluebird'); +thenableNum = Bluebird.resolve(1); diff --git a/chai-as-promised/chai-as-promised-tests-with-q.ts b/chai-as-promised/chai-as-promised-tests-with-q.ts new file mode 100644 index 0000000000..91fe676cd1 --- /dev/null +++ b/chai-as-promised/chai-as-promised-tests-with-q.ts @@ -0,0 +1,7 @@ +/// +/// + +// Compatibility check for Promise/A+ valid libraries +var thenableNum: Chai.Thenable; +import Q = require('q'); +thenableNum = Q.resolve(1); diff --git a/chai-as-promised/chai-as-promised-tests.ts b/chai-as-promised/chai-as-promised-tests.ts index 95a4335173..dd528e9f68 100644 --- a/chai-as-promised/chai-as-promised-tests.ts +++ b/chai-as-promised/chai-as-promised-tests.ts @@ -1,23 +1,53 @@ /// +/// import chai = require('chai'); import chaiAsPromised = require('chai-as-promised'); +import Q = require('q'); chai.use(chaiAsPromised); // ReSharper disable WrongExpressionStatement -var promise: any; -chai.expect(promise).to.eventually.equal(3); -chai.expect(promise).to.become(3); -chai.expect(promise).to.be.fulfilled; -chai.expect(promise).to.be.rejected; -chai.expect(promise).to.be.rejectedWith(Error); -chai.expect(promise).to.notify(() => console.log('done')); +// BDD API (expect) +var thenableNum: Chai.Thenable; +thenableNum = chai.expect(thenableNum).to.eventually.equal(3); +thenableNum = chai.expect(thenableNum).to.eventually.have.property('foo'); +thenableNum = chai.expect(thenableNum).to.become(3); +thenableNum = chai.expect(thenableNum).to.be.fulfilled; +thenableNum = chai.expect(thenableNum).to.be.rejected; +thenableNum = chai.expect(thenableNum).to.be.rejectedWith(Error); +thenableNum = chai.expect(thenableNum).to.notify(() => console.log('done')); -chai.assert.eventually.equal(promise, 4, 'Message'); -chai.assert.isFulfilled(promise, "optional message"); -chai.assert.becomes(promise, "foo", "optional message"); -chai.assert.doesNotBecome(promise, "foo", "optional message"); -chai.assert.isRejected(promise, "optional message"); -chai.assert.isRejected(promise, Error, "optional message"); -chai.assert.isRejected(promise, /error message matcher/, "optional message"); +// BDD API (should) +thenableNum = thenableNum.should.be.fulfilled; +thenableNum = thenableNum.should.eventually.deep.equal(3); +thenableNum = thenableNum.should.become(3); +thenableNum = thenableNum.should.be.rejected; +thenableNum = thenableNum.should.be.rejectedWith(Error); +thenableNum = thenableNum.should.eventually.equal(3).notify(() => console.log('done')); +thenableNum = thenableNum.should.be.fulfilled.and.notify(() => console.log('done')); + +// Complex examples on https://github.com/domenic/chai-as-promised#working-with-non-promisefriendly-test-runners +thenableNum.should.be.fulfilled.then(function () { + thenableNum.should.equal("after"); +}).should.notify(() => console.log('done')); + +Q.all([ + thenableNum.should.become("happy"), + thenableNum.should.eventually.have.property("fun times"), + thenableNum.should.be.rejectedWith(TypeError, "only joyful types are allowed") +]).should.notify(() => console.log('done')); + +// Assert API +var thenableVoid: Chai.Thenable; +thenableVoid = chai.assert.eventually.equal(thenableNum, 4, 'Message'); +thenableVoid = chai.assert.isFulfilled(thenableNum, "optional message"); +thenableVoid = chai.assert.becomes(thenableNum, "foo", "optional message"); +thenableVoid = chai.assert.doesNotBecome(thenableNum, "foo", "optional message"); +thenableVoid = chai.assert.isRejected(thenableNum, "optional message"); +thenableVoid = chai.assert.isRejected(thenableNum, Error, "optional message"); +thenableVoid = chai.assert.isRejected(thenableNum, /error message matcher/, "optional message"); + +// Check that original chai assertions are not broken +var undef: void; +undef = chai.assert.equal(10, 4, 'Message'); diff --git a/chai-as-promised/chai-as-promised.d.ts b/chai-as-promised/chai-as-promised.d.ts index 106bbf41e8..5b68b0b5d3 100644 --- a/chai-as-promised/chai-as-promised.d.ts +++ b/chai-as-promised/chai-as-promised.d.ts @@ -12,25 +12,278 @@ declare module 'chai-as-promised' { declare module Chai { - interface Assertion { - become(expected: any): Assertion; - fulfilled: Assertion; - rejected: Assertion; - rejectedWith(expected: any): Assertion; - notify(fn: Function): Assertion; + // chai-as-promised can take Promise/A+ valid promises. + interface Thenable { + then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; + then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Thenable; } - interface LanguageChains { - eventually: Assertion; + // For BDD API + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + eventually: PromisedAssertion; + become(expected: any): PromisedAssertion; + fulfilled: PromisedAssertion; + rejected: PromisedAssertion; + rejectedWith(expected: any, message?: string): PromisedAssertion; + notify(fn: Function): PromisedAssertion; } + // Eventually does not have .then(), but PromisedAssertion have. + interface Eventually extends PromisedLanguageChains, PromisedNumericComparison, PromisedTypeComparison { + // From chai-as-promised + become(expected: Thenable): PromisedAssertion; + fulfilled: PromisedAssertion; + rejected: PromisedAssertion; + rejectedWith(expected: any): PromisedAssertion; + notify(fn: Function): PromisedAssertion; + + // From chai + not: PromisedAssertion; + deep: PromisedDeep; + a: PromisedTypeComparison; + an: PromisedTypeComparison; + include: PromisedInclude; + contain: PromisedInclude; + ok: PromisedAssertion; + true: PromisedAssertion; + false: PromisedAssertion; + null: PromisedAssertion; + undefined: PromisedAssertion; + exist: PromisedAssertion; + empty: PromisedAssertion; + arguments: PromisedAssertion; + Arguments: PromisedAssertion; + equal: PromisedEqual; + equals: PromisedEqual; + eq: PromisedEqual; + eql: PromisedEqual; + eqls: PromisedEqual; + property: PromisedProperty; + ownProperty: PromisedOwnProperty; + haveOwnProperty: PromisedOwnProperty; + length: PromisedLength; + lengthOf: PromisedLength; + match(regexp: RegExp|string, message?: string): PromisedAssertion; + string(string: string, message?: string): PromisedAssertion; + keys: PromisedKeys; + key(string: string): PromisedAssertion; + throw: PromisedThrow; + throws: PromisedThrow; + Throw: PromisedThrow; + respondTo(method: string, message?: string): PromisedAssertion; + itself: PromisedAssertion; + satisfy(matcher: Function, message?: string): PromisedAssertion; + closeTo(expected: number, delta: number, message?: string): PromisedAssertion; + members: PromisedMembers; + } + + interface PromisedAssertion extends Eventually, Thenable { + } + + interface PromisedLanguageChains { + eventually: Eventually; + + // From chai + to: PromisedAssertion; + be: PromisedAssertion; + been: PromisedAssertion; + is: PromisedAssertion; + that: PromisedAssertion; + which: PromisedAssertion; + and: PromisedAssertion; + has: PromisedAssertion; + have: PromisedAssertion; + with: PromisedAssertion; + at: PromisedAssertion; + of: PromisedAssertion; + same: PromisedAssertion; + } + + interface PromisedNumericComparison { + above: PromisedNumberComparer; + gt: PromisedNumberComparer; + greaterThan: PromisedNumberComparer; + least: PromisedNumberComparer; + gte: PromisedNumberComparer; + below: PromisedNumberComparer; + lt: PromisedNumberComparer; + lessThan: PromisedNumberComparer; + most: PromisedNumberComparer; + lte: PromisedNumberComparer; + within(start: number, finish: number, message?: string): PromisedAssertion; + } + + interface PromisedNumberComparer { + (value: number, message?: string): PromisedAssertion; + } + + interface PromisedTypeComparison { + (type: string, message?: string): PromisedAssertion; + instanceof: PromisedInstanceOf; + instanceOf: PromisedInstanceOf; + } + + interface PromisedInstanceOf { + (constructor: Object, message?: string): PromisedAssertion; + } + + interface PromisedDeep { + equal: PromisedEqual; + include: PromisedInclude; + property: PromisedProperty; + } + + interface PromisedEqual { + (value: any, message?: string): PromisedAssertion; + } + + interface PromisedProperty { + (name: string, value?: any, message?: string): PromisedAssertion; + } + + interface PromisedOwnProperty { + (name: string, message?: string): PromisedAssertion; + } + + interface PromisedLength extends PromisedLanguageChains, PromisedNumericComparison { + (length: number, message?: string): PromisedAssertion; + } + + interface PromisedInclude { + (value: Object, message?: string): PromisedAssertion; + (value: string, message?: string): PromisedAssertion; + (value: number, message?: string): PromisedAssertion; + keys: PromisedKeys; + members: PromisedMembers; + } + + interface PromisedKeys { + (...keys: string[]): PromisedAssertion; + (keys: any[]): PromisedAssertion; + } + + interface PromisedThrow { + (): PromisedAssertion; + (expected: string, message?: string): PromisedAssertion; + (expected: RegExp, message?: string): PromisedAssertion; + (constructor: Error, expected?: string, message?: string): PromisedAssertion; + (constructor: Error, expected?: RegExp, message?: string): PromisedAssertion; + (constructor: Function, expected?: string, message?: string): PromisedAssertion; + (constructor: Function, expected?: RegExp, message?: string): PromisedAssertion; + } + + interface PromisedMembers { + (set: any[], message?: string): PromisedAssertion; + } + + // For Assert API interface Assert { - eventually: Assert; - isFulfilled(promise: any, message?: string): void; - becomes(promise: any, expected: any, message?: string): void; - doesNotBecome(promise: any, expected: any, message?: string): void; - isRejected(promise: any, message?: string): void; - isRejected(promise: any, expected: any, message?: string): void; - isRejected(promise: any, match: RegExp, message?: string): void; + eventually: PromisedAssert; + isFulfilled(promise: Thenable, message?: string): Thenable; + becomes(promise: Thenable, expected: any, message?: string): Thenable; + doesNotBecome(promise: Thenable, expected: any, message?: string): Thenable; + isRejected(promise: Thenable, message?: string): Thenable; + isRejected(promise: Thenable, expected: any, message?: string): Thenable; + isRejected(promise: Thenable, match: RegExp, message?: string): Thenable; + notify(fn: Function): Thenable; + } + + export interface PromisedAssert { + fail(actual?: any, expected?: any, msg?: string, operator?: string): Thenable; + + ok(val: any, msg?: string): Thenable; + notOk(val: any, msg?: string): Thenable; + + equal(act: any, exp: any, msg?: string): Thenable; + notEqual(act: any, exp: any, msg?: string): Thenable; + + strictEqual(act: any, exp: any, msg?: string): Thenable; + notStrictEqual(act: any, exp: any, msg?: string): Thenable; + + deepEqual(act: any, exp: any, msg?: string): Thenable; + notDeepEqual(act: any, exp: any, msg?: string): Thenable; + + isTrue(val: any, msg?: string): Thenable; + isFalse(val: any, msg?: string): Thenable; + + isNull(val: any, msg?: string): Thenable; + isNotNull(val: any, msg?: string): Thenable; + + isUndefined(val: any, msg?: string): Thenable; + isDefined(val: any, msg?: string): Thenable; + + isFunction(val: any, msg?: string): Thenable; + isNotFunction(val: any, msg?: string): Thenable; + + isObject(val: any, msg?: string): Thenable; + isNotObject(val: any, msg?: string): Thenable; + + isArray(val: any, msg?: string): Thenable; + isNotArray(val: any, msg?: string): Thenable; + + isString(val: any, msg?: string): Thenable; + isNotString(val: any, msg?: string): Thenable; + + isNumber(val: any, msg?: string): Thenable; + isNotNumber(val: any, msg?: string): Thenable; + + isBoolean(val: any, msg?: string): Thenable; + isNotBoolean(val: any, msg?: string): Thenable; + + typeOf(val: any, type: string, msg?: string): Thenable; + notTypeOf(val: any, type: string, msg?: string): Thenable; + + instanceOf(val: any, type: Function, msg?: string): Thenable; + notInstanceOf(val: any, type: Function, msg?: string): Thenable; + + include(exp: string, inc: any, msg?: string): Thenable; + include(exp: any[], inc: any, msg?: string): Thenable; + + notInclude(exp: string, inc: any, msg?: string): Thenable; + notInclude(exp: any[], inc: any, msg?: string): Thenable; + + match(exp: any, re: RegExp, msg?: string): Thenable; + notMatch(exp: any, re: RegExp, msg?: string): Thenable; + + property(obj: Object, prop: string, msg?: string): Thenable; + notProperty(obj: Object, prop: string, msg?: string): Thenable; + deepProperty(obj: Object, prop: string, msg?: string): Thenable; + notDeepProperty(obj: Object, prop: string, msg?: string): Thenable; + + propertyVal(obj: Object, prop: string, val: any, msg?: string): Thenable; + propertyNotVal(obj: Object, prop: string, val: any, msg?: string): Thenable; + + deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): Thenable; + deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): Thenable; + + lengthOf(exp: any, len: number, msg?: string): Thenable; + //alias frenzy + throw(fn: Function, msg?: string): Thenable; + throw(fn: Function, regExp: RegExp): Thenable; + throw(fn: Function, errType: Function, msg?: string): Thenable; + throw(fn: Function, errType: Function, regExp: RegExp): Thenable; + + throws(fn: Function, msg?: string): Thenable; + throws(fn: Function, regExp: RegExp): Thenable; + throws(fn: Function, errType: Function, msg?: string): Thenable; + throws(fn: Function, errType: Function, regExp: RegExp): Thenable; + + Throw(fn: Function, msg?: string): Thenable; + Throw(fn: Function, regExp: RegExp): Thenable; + Throw(fn: Function, errType: Function, msg?: string): Thenable; + Throw(fn: Function, errType: Function, regExp: RegExp): Thenable; + + doesNotThrow(fn: Function, msg?: string): Thenable; + doesNotThrow(fn: Function, regExp: RegExp): Thenable; + doesNotThrow(fn: Function, errType: Function, msg?: string): Thenable; + doesNotThrow(fn: Function, errType: Function, regExp: RegExp): Thenable; + + operator(val: any, operator: string, val2: any, msg?: string): Thenable; + closeTo(act: number, exp: number, delta: number, msg?: string): Thenable; + + sameMembers(set1: any[], set2: any[], msg?: string): Thenable; + includeMembers(set1: any[], set2: any[], msg?: string): Thenable; + + ifError(val: any, msg?: string): Thenable; } } From 49c153d83b8f70d4dbf77fa3beab6b9dcf4891fa Mon Sep 17 00:00:00 2001 From: Kuniwak Date: Mon, 24 Aug 2015 19:57:24 +0900 Subject: [PATCH 2/3] Add Kuniwak to credits --- chai-as-promised/chai-as-promised.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chai-as-promised/chai-as-promised.d.ts b/chai-as-promised/chai-as-promised.d.ts index 5b68b0b5d3..e6644b03cc 100644 --- a/chai-as-promised/chai-as-promised.d.ts +++ b/chai-as-promised/chai-as-promised.d.ts @@ -1,6 +1,6 @@ // Type definitions for chai-as-promised // Project: https://github.com/domenic/chai-as-promised/ -// Definitions by: jt000 +// Definitions by: jt000 , Yuki Kokubun // Definitions: https://github.com/borisyankov/DefinitelyTyped /// From 0fafec2327aa6283bfcca29f946cfd1bcfcbd683 Mon Sep 17 00:00:00 2001 From: Kuniwak Date: Tue, 25 Aug 2015 16:37:14 +0900 Subject: [PATCH 3/3] Use PromisesAPlus.Thenable --- .../chai-as-promised-tests-with-bluebird.ts | 7 - .../chai-as-promised-tests-with-q.ts | 7 - chai-as-promised/chai-as-promised-tests.ts | 5 +- chai-as-promised/chai-as-promised.d.ts | 159 +++++++++--------- 4 files changed, 80 insertions(+), 98 deletions(-) delete mode 100644 chai-as-promised/chai-as-promised-tests-with-bluebird.ts delete mode 100644 chai-as-promised/chai-as-promised-tests-with-q.ts diff --git a/chai-as-promised/chai-as-promised-tests-with-bluebird.ts b/chai-as-promised/chai-as-promised-tests-with-bluebird.ts deleted file mode 100644 index e27205c41b..0000000000 --- a/chai-as-promised/chai-as-promised-tests-with-bluebird.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -/// - -// Compatibility check for Promise/A+ valid libraries -var thenableNum: Chai.Thenable; -import Bluebird = require('bluebird'); -thenableNum = Bluebird.resolve(1); diff --git a/chai-as-promised/chai-as-promised-tests-with-q.ts b/chai-as-promised/chai-as-promised-tests-with-q.ts deleted file mode 100644 index 91fe676cd1..0000000000 --- a/chai-as-promised/chai-as-promised-tests-with-q.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -/// - -// Compatibility check for Promise/A+ valid libraries -var thenableNum: Chai.Thenable; -import Q = require('q'); -thenableNum = Q.resolve(1); diff --git a/chai-as-promised/chai-as-promised-tests.ts b/chai-as-promised/chai-as-promised-tests.ts index dd528e9f68..0b747d2c4c 100644 --- a/chai-as-promised/chai-as-promised-tests.ts +++ b/chai-as-promised/chai-as-promised-tests.ts @@ -1,4 +1,5 @@ /// +/// /// import chai = require('chai'); @@ -9,7 +10,7 @@ chai.use(chaiAsPromised); // ReSharper disable WrongExpressionStatement // BDD API (expect) -var thenableNum: Chai.Thenable; +var thenableNum: PromisesAPlus.Thenable; thenableNum = chai.expect(thenableNum).to.eventually.equal(3); thenableNum = chai.expect(thenableNum).to.eventually.have.property('foo'); thenableNum = chai.expect(thenableNum).to.become(3); @@ -39,7 +40,7 @@ Q.all([ ]).should.notify(() => console.log('done')); // Assert API -var thenableVoid: Chai.Thenable; +var thenableVoid: PromisesAPlus.Thenable; thenableVoid = chai.assert.eventually.equal(thenableNum, 4, 'Message'); thenableVoid = chai.assert.isFulfilled(thenableNum, "optional message"); thenableVoid = chai.assert.becomes(thenableNum, "foo", "optional message"); diff --git a/chai-as-promised/chai-as-promised.d.ts b/chai-as-promised/chai-as-promised.d.ts index e6644b03cc..51255b4902 100644 --- a/chai-as-promised/chai-as-promised.d.ts +++ b/chai-as-promised/chai-as-promised.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /// +/// declare module 'chai-as-promised' { function chaiAsPromised(chai: any, utils: any): void; @@ -12,12 +13,6 @@ declare module 'chai-as-promised' { declare module Chai { - // chai-as-promised can take Promise/A+ valid promises. - interface Thenable { - then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; - then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Thenable; - } - // For BDD API interface Assertion extends LanguageChains, NumericComparison, TypeComparison { eventually: PromisedAssertion; @@ -31,7 +26,7 @@ declare module Chai { // Eventually does not have .then(), but PromisedAssertion have. interface Eventually extends PromisedLanguageChains, PromisedNumericComparison, PromisedTypeComparison { // From chai-as-promised - become(expected: Thenable): PromisedAssertion; + become(expected: PromisesAPlus.Thenable): PromisedAssertion; fulfilled: PromisedAssertion; rejected: PromisedAssertion; rejectedWith(expected: any): PromisedAssertion; @@ -77,7 +72,7 @@ declare module Chai { members: PromisedMembers; } - interface PromisedAssertion extends Eventually, Thenable { + interface PromisedAssertion extends Eventually, PromisesAPlus.Thenable { } interface PromisedLanguageChains { @@ -179,111 +174,111 @@ declare module Chai { // For Assert API interface Assert { eventually: PromisedAssert; - isFulfilled(promise: Thenable, message?: string): Thenable; - becomes(promise: Thenable, expected: any, message?: string): Thenable; - doesNotBecome(promise: Thenable, expected: any, message?: string): Thenable; - isRejected(promise: Thenable, message?: string): Thenable; - isRejected(promise: Thenable, expected: any, message?: string): Thenable; - isRejected(promise: Thenable, match: RegExp, message?: string): Thenable; - notify(fn: Function): Thenable; + isFulfilled(promise: PromisesAPlus.Thenable, message?: string): PromisesAPlus.Thenable; + becomes(promise: PromisesAPlus.Thenable, expected: any, message?: string): PromisesAPlus.Thenable; + doesNotBecome(promise: PromisesAPlus.Thenable, expected: any, message?: string): PromisesAPlus.Thenable; + isRejected(promise: PromisesAPlus.Thenable, message?: string): PromisesAPlus.Thenable; + isRejected(promise: PromisesAPlus.Thenable, expected: any, message?: string): PromisesAPlus.Thenable; + isRejected(promise: PromisesAPlus.Thenable, match: RegExp, message?: string): PromisesAPlus.Thenable; + notify(fn: Function): PromisesAPlus.Thenable; } export interface PromisedAssert { - fail(actual?: any, expected?: any, msg?: string, operator?: string): Thenable; + fail(actual?: any, expected?: any, msg?: string, operator?: string): PromisesAPlus.Thenable; - ok(val: any, msg?: string): Thenable; - notOk(val: any, msg?: string): Thenable; + ok(val: any, msg?: string): PromisesAPlus.Thenable; + notOk(val: any, msg?: string): PromisesAPlus.Thenable; - equal(act: any, exp: any, msg?: string): Thenable; - notEqual(act: any, exp: any, msg?: string): Thenable; + equal(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; + notEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; - strictEqual(act: any, exp: any, msg?: string): Thenable; - notStrictEqual(act: any, exp: any, msg?: string): Thenable; + strictEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; + notStrictEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; - deepEqual(act: any, exp: any, msg?: string): Thenable; - notDeepEqual(act: any, exp: any, msg?: string): Thenable; + deepEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; + notDeepEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; - isTrue(val: any, msg?: string): Thenable; - isFalse(val: any, msg?: string): Thenable; + isTrue(val: any, msg?: string): PromisesAPlus.Thenable; + isFalse(val: any, msg?: string): PromisesAPlus.Thenable; - isNull(val: any, msg?: string): Thenable; - isNotNull(val: any, msg?: string): Thenable; + isNull(val: any, msg?: string): PromisesAPlus.Thenable; + isNotNull(val: any, msg?: string): PromisesAPlus.Thenable; - isUndefined(val: any, msg?: string): Thenable; - isDefined(val: any, msg?: string): Thenable; + isUndefined(val: any, msg?: string): PromisesAPlus.Thenable; + isDefined(val: any, msg?: string): PromisesAPlus.Thenable; - isFunction(val: any, msg?: string): Thenable; - isNotFunction(val: any, msg?: string): Thenable; + isFunction(val: any, msg?: string): PromisesAPlus.Thenable; + isNotFunction(val: any, msg?: string): PromisesAPlus.Thenable; - isObject(val: any, msg?: string): Thenable; - isNotObject(val: any, msg?: string): Thenable; + isObject(val: any, msg?: string): PromisesAPlus.Thenable; + isNotObject(val: any, msg?: string): PromisesAPlus.Thenable; - isArray(val: any, msg?: string): Thenable; - isNotArray(val: any, msg?: string): Thenable; + isArray(val: any, msg?: string): PromisesAPlus.Thenable; + isNotArray(val: any, msg?: string): PromisesAPlus.Thenable; - isString(val: any, msg?: string): Thenable; - isNotString(val: any, msg?: string): Thenable; + isString(val: any, msg?: string): PromisesAPlus.Thenable; + isNotString(val: any, msg?: string): PromisesAPlus.Thenable; - isNumber(val: any, msg?: string): Thenable; - isNotNumber(val: any, msg?: string): Thenable; + isNumber(val: any, msg?: string): PromisesAPlus.Thenable; + isNotNumber(val: any, msg?: string): PromisesAPlus.Thenable; - isBoolean(val: any, msg?: string): Thenable; - isNotBoolean(val: any, msg?: string): Thenable; + isBoolean(val: any, msg?: string): PromisesAPlus.Thenable; + isNotBoolean(val: any, msg?: string): PromisesAPlus.Thenable; - typeOf(val: any, type: string, msg?: string): Thenable; - notTypeOf(val: any, type: string, msg?: string): Thenable; + typeOf(val: any, type: string, msg?: string): PromisesAPlus.Thenable; + notTypeOf(val: any, type: string, msg?: string): PromisesAPlus.Thenable; - instanceOf(val: any, type: Function, msg?: string): Thenable; - notInstanceOf(val: any, type: Function, msg?: string): Thenable; + instanceOf(val: any, type: Function, msg?: string): PromisesAPlus.Thenable; + notInstanceOf(val: any, type: Function, msg?: string): PromisesAPlus.Thenable; - include(exp: string, inc: any, msg?: string): Thenable; - include(exp: any[], inc: any, msg?: string): Thenable; + include(exp: string, inc: any, msg?: string): PromisesAPlus.Thenable; + include(exp: any[], inc: any, msg?: string): PromisesAPlus.Thenable; - notInclude(exp: string, inc: any, msg?: string): Thenable; - notInclude(exp: any[], inc: any, msg?: string): Thenable; + notInclude(exp: string, inc: any, msg?: string): PromisesAPlus.Thenable; + notInclude(exp: any[], inc: any, msg?: string): PromisesAPlus.Thenable; - match(exp: any, re: RegExp, msg?: string): Thenable; - notMatch(exp: any, re: RegExp, msg?: string): Thenable; + match(exp: any, re: RegExp, msg?: string): PromisesAPlus.Thenable; + notMatch(exp: any, re: RegExp, msg?: string): PromisesAPlus.Thenable; - property(obj: Object, prop: string, msg?: string): Thenable; - notProperty(obj: Object, prop: string, msg?: string): Thenable; - deepProperty(obj: Object, prop: string, msg?: string): Thenable; - notDeepProperty(obj: Object, prop: string, msg?: string): Thenable; + property(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable; + notProperty(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable; + deepProperty(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable; + notDeepProperty(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable; - propertyVal(obj: Object, prop: string, val: any, msg?: string): Thenable; - propertyNotVal(obj: Object, prop: string, val: any, msg?: string): Thenable; + propertyVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable; + propertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable; - deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): Thenable; - deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): Thenable; + deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable; + deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable; - lengthOf(exp: any, len: number, msg?: string): Thenable; + lengthOf(exp: any, len: number, msg?: string): PromisesAPlus.Thenable; //alias frenzy - throw(fn: Function, msg?: string): Thenable; - throw(fn: Function, regExp: RegExp): Thenable; - throw(fn: Function, errType: Function, msg?: string): Thenable; - throw(fn: Function, errType: Function, regExp: RegExp): Thenable; + throw(fn: Function, msg?: string): PromisesAPlus.Thenable; + throw(fn: Function, regExp: RegExp): PromisesAPlus.Thenable; + throw(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable; + throw(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable; - throws(fn: Function, msg?: string): Thenable; - throws(fn: Function, regExp: RegExp): Thenable; - throws(fn: Function, errType: Function, msg?: string): Thenable; - throws(fn: Function, errType: Function, regExp: RegExp): Thenable; + throws(fn: Function, msg?: string): PromisesAPlus.Thenable; + throws(fn: Function, regExp: RegExp): PromisesAPlus.Thenable; + throws(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable; + throws(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable; - Throw(fn: Function, msg?: string): Thenable; - Throw(fn: Function, regExp: RegExp): Thenable; - Throw(fn: Function, errType: Function, msg?: string): Thenable; - Throw(fn: Function, errType: Function, regExp: RegExp): Thenable; + Throw(fn: Function, msg?: string): PromisesAPlus.Thenable; + Throw(fn: Function, regExp: RegExp): PromisesAPlus.Thenable; + Throw(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable; + Throw(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable; - doesNotThrow(fn: Function, msg?: string): Thenable; - doesNotThrow(fn: Function, regExp: RegExp): Thenable; - doesNotThrow(fn: Function, errType: Function, msg?: string): Thenable; - doesNotThrow(fn: Function, errType: Function, regExp: RegExp): Thenable; + doesNotThrow(fn: Function, msg?: string): PromisesAPlus.Thenable; + doesNotThrow(fn: Function, regExp: RegExp): PromisesAPlus.Thenable; + doesNotThrow(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable; + doesNotThrow(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable; - operator(val: any, operator: string, val2: any, msg?: string): Thenable; - closeTo(act: number, exp: number, delta: number, msg?: string): Thenable; + operator(val: any, operator: string, val2: any, msg?: string): PromisesAPlus.Thenable; + closeTo(act: number, exp: number, delta: number, msg?: string): PromisesAPlus.Thenable; - sameMembers(set1: any[], set2: any[], msg?: string): Thenable; - includeMembers(set1: any[], set2: any[], msg?: string): Thenable; + sameMembers(set1: any[], set2: any[], msg?: string): PromisesAPlus.Thenable; + includeMembers(set1: any[], set2: any[], msg?: string): PromisesAPlus.Thenable; - ifError(val: any, msg?: string): Thenable; + ifError(val: any, msg?: string): PromisesAPlus.Thenable; } }