From dd19153965531640b83b60a0ea0e6268c88de836 Mon Sep 17 00:00:00 2001 From: Jacob Boland Date: Fri, 11 Oct 2013 15:11:36 -0700 Subject: [PATCH 1/2] Add 'use' to chai and include a test --- chai/chai-tests.ts | 6 ++++++ chai/chai.d.ts | 2 ++ 2 files changed, 8 insertions(+) diff --git a/chai/chai-tests.ts b/chai/chai-tests.ts index 8a09c3f42..b559c515d 100644 --- a/chai/chai-tests.ts +++ b/chai/chai-tests.ts @@ -688,6 +688,12 @@ function _throw() { }, "blah: expected [Function] to throw error including 'hello' but got 'testing'"); } +function use(){ + chai.use(function (_chai, utils) { + _chai.can.use.any(); + }); +} + function respondTo() { function Foo() {}; var bar = {}; diff --git a/chai/chai.d.ts b/chai/chai.d.ts index 9d649a17c..8e33f8590 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -8,6 +8,8 @@ declare module chai { function expect(target: any): Expect; + function use(fn: (chai: any, utils: any) => void); + interface ExpectStatic { (target: any): Expect; } From e43a0edd92a800258c12d1d9b06f016a0224833b Mon Sep 17 00:00:00 2001 From: Jacob Boland Date: Wed, 23 Oct 2013 09:48:43 -0700 Subject: [PATCH 2/2] Add comment to describe new use function definition --- chai/chai.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/chai/chai.d.ts b/chai/chai.d.ts index 8e33f8590..9fc93a667 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -8,6 +8,7 @@ declare module chai { function expect(target: any): Expect; + // Provides a way to extend the internals of Chai function use(fn: (chai: any, utils: any) => void); interface ExpectStatic {