From e28977c676be0cb9e2b68e61e72e2d8132e9cb54 Mon Sep 17 00:00:00 2001 From: teppeis Date: Sat, 8 Aug 2015 18:11:05 +0900 Subject: [PATCH] feat(expect.js): bump v0.3.1 adding withArgs --- expect.js/expect.js-commonjs-tests.ts | 6 ++++++ expect.js/expect.js-tests.ts | 6 ++++++ expect.js/expect.js.d.ts | 9 +++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/expect.js/expect.js-commonjs-tests.ts b/expect.js/expect.js-commonjs-tests.ts index e95b870d9d..58e1a34588 100644 --- a/expect.js/expect.js-commonjs-tests.ts +++ b/expect.js/expect.js-commonjs-tests.ts @@ -103,6 +103,12 @@ function test_throwException() { expect(fn).to.not.throwException(); } +function test_withArgs() { + var fn = () => {}; + expect(fn).withArgs().to.throwException(); + expect(fn).withArgs(true, 1, '').to.throwException(); +} + function test_within() { expect(1).to.be.within(0, Infinity); } diff --git a/expect.js/expect.js-tests.ts b/expect.js/expect.js-tests.ts index 7b19219bb4..38b5ab3a83 100644 --- a/expect.js/expect.js-tests.ts +++ b/expect.js/expect.js-tests.ts @@ -101,6 +101,12 @@ function test_throwException() { expect(fn).to.not.throwException(); } +function test_withArgs() { + var fn = () => {}; + expect(fn).withArgs().to.throwException(); + expect(fn).withArgs(true, 1, '').to.throwException(); +} + function test_within() { expect(1).to.be.within(0, Infinity); } diff --git a/expect.js/expect.js.d.ts b/expect.js/expect.js.d.ts index 2db884b97b..12ba1d1b72 100644 --- a/expect.js/expect.js.d.ts +++ b/expect.js/expect.js.d.ts @@ -1,5 +1,5 @@ -// Type definitions for expect.js 0.2.0 -// Project: https://github.com/LearnBoost/expect.js +// Type definitions for expect.js 0.3.1 +// Project: https://github.com/Automattic/expect.js // Definitions by: Teppei Sato // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -12,6 +12,11 @@ declare module Expect { */ ok(): void; + /** + * Creates an anonymous function which calls fn with arguments. + */ + withArgs(...args: any[]): Root; + /** * Assert that the function throws. *