From 26132abd60790f91134e61ef4969fb2e85f48a2a Mon Sep 17 00:00:00 2001 From: Todd Wolfson Date: Fri, 12 Apr 2013 02:06:48 -0700 Subject: [PATCH 1/9] Added files for testling integration --- README.md | 4 +++- package.json | 21 +++++++++++++++++++++ test/browser/bootstrap.js | 12 ++++++++++++ test/browser/index.html | 15 +-------------- 4 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 test/browser/bootstrap.js diff --git a/README.md b/README.md index f2c349a61..d9b68635b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ [![Build Status](https://travis-ci.org/chaijs/chai.png?branch=master)](https://travis-ci.org/chaijs/chai) +[![browser support](https://ci.testling.com/chaijs/chai.png)](https://ci.testling.com/chaijs/chai) + [![Chai Documentation](http://chaijs.com/public/img/chai-logo.png)](http://chaijs.com) Chai is a BDD / TDD assertion library for [node](http://nodejs.org) and the browser that @@ -14,7 +16,7 @@ For more information or to download plugins, view the [documentation](http://cha active : 117 days commits : 616 files : 56 - authors : + authors : 459 Jake Luer 74.5% 66 Veselin Todorov 10.7% 42 Domenic Denicola 6.8% diff --git a/package.json b/package.json index ad9f3cc37..713fe7e03 100644 --- a/package.json +++ b/package.json @@ -34,5 +34,26 @@ , "mocha-cloud": "*" , "mocha-phantomjs": "*" , "connect": "2.7.x" + }, + "testling": { + "files": [], + "scripts": [ + "chai.js", + "test/bootstrap/index.js", + "test/*.js" + ], + "harness": "mocha-tdd", + "browsers": [ + "ie/6..latest", + "chrome/20..latest", + "chrome/canary", + "firefox/10..latest", + "firefox/nightly", + "safari/latest", + "opera/11.0..latest", + "opera/next", + "iphone/6", + "ipad/6" + ] } } diff --git a/test/browser/bootstrap.js b/test/browser/bootstrap.js new file mode 100644 index 000000000..bf2e3d1d3 --- /dev/null +++ b/test/browser/bootstrap.js @@ -0,0 +1,12 @@ +err = function (fn, msg) { + try { + fn(); + throw new chai.AssertionError({ message: 'Expected an error' }); + } catch (err) { + if ('string' === typeof msg) { + chai.expect(err.message).to.equal(msg); + } else { + chai.expect(err.message).to.match(msg); + } + } +}; \ No newline at end of file diff --git a/test/browser/index.html b/test/browser/index.html index 1d2c837b4..4408531e9 100644 --- a/test/browser/index.html +++ b/test/browser/index.html @@ -7,20 +7,7 @@ - + From 144a7598840b329720c4c852633b0e8783b99ac2 Mon Sep 17 00:00:00 2001 From: Todd Wolfson Date: Fri, 12 Apr 2013 02:08:28 -0700 Subject: [PATCH 2/9] Pointed to wrong bootstrap.js >_< --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 713fe7e03..779da0942 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "files": [], "scripts": [ "chai.js", - "test/bootstrap/index.js", + "test/browser/bootstrap.js", "test/*.js" ], "harness": "mocha-tdd", From d753a4a15de612dbf86d59a7f5126e897e59eec2 Mon Sep 17 00:00:00 2001 From: Todd Wolfson Date: Fri, 12 Apr 2013 02:14:10 -0700 Subject: [PATCH 3/9] Something seemed to get lost in last build --- chai.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/chai.js b/chai.js index 999e9303d..0d946f65d 100644 --- a/chai.js +++ b/chai.js @@ -2678,6 +2678,10 @@ // and there seems no easy cross-platform way to detect them (@see chaijs/chai/issues/69). var excludeNames = /^(?:length|name|arguments|caller)$/; + // Cache `Function` properties + var call = Function.prototype.call, + apply = Function.prototype.apply; + /** * ### addChainableMethod (ctx, name, method, chainingBehavior) * @@ -2721,7 +2725,11 @@ // Use `__proto__` if available if (hasProtoSupport) { - assert.__proto__ = this; + // Inherit all properties from the object by replacing the `Function` prototype + var prototype = assert.__proto__ = Object.create(this); + // Restore the `call` and `apply` methods from `Function` + prototype.call = call; + prototype.apply = apply; } // Otherwise, redefine all properties (slow!) else { From 377aea5d8de2041e1ae33ef33e4997b17cd663c7 Mon Sep 17 00:00:00 2001 From: Todd Wolfson Date: Fri, 12 Apr 2013 02:17:34 -0700 Subject: [PATCH 4/9] Patch for "expect satisfy" failing in IE10 --- test/expect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/expect.js b/test/expect.js index 01b142d27..d06e0bca3 100644 --- a/test/expect.js +++ b/test/expect.js @@ -702,7 +702,7 @@ suite('expect', function () { err(function(){ expect(2).to.satisfy(matcher, 'blah'); - }, "blah: expected 2 to satisfy [Function: matcher]"); + }, /blah: expected 2 to satisfy \[Function: matcher\s*\]/); }); test('closeTo', function(){ From 4903e6c34562c02de1f6bad8a6bad35e9d8199d3 Mon Sep 17 00:00:00 2001 From: Todd Wolfson Date: Sat, 13 Apr 2013 15:01:59 -0700 Subject: [PATCH 5/9] Removing failing browsers from testling-ci --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 779da0942..8df45ec12 100644 --- a/package.json +++ b/package.json @@ -44,13 +44,13 @@ ], "harness": "mocha-tdd", "browsers": [ - "ie/6..latest", + "ie/10..latest", "chrome/20..latest", "chrome/canary", "firefox/10..latest", "firefox/nightly", "safari/latest", - "opera/11.0..latest", + "opera/11.6..latest", "opera/next", "iphone/6", "ipad/6" From 8cf3d822970edf6bd2d3c7f3886cdcd4b2452062 Mon Sep 17 00:00:00 2001 From: Todd Wolfson Date: Sat, 13 Apr 2013 15:55:06 -0700 Subject: [PATCH 6/9] Testling is failing to kick off with last change, trying manually delimited browsers --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8df45ec12..638039dcc 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,8 @@ "firefox/10..latest", "firefox/nightly", "safari/latest", - "opera/11.6..latest", + "opera/11.6", + "opera/12.0", "opera/next", "iphone/6", "ipad/6" From 554364cb27202440f4a8ea9129996b791041c38f Mon Sep 17 00:00:00 2001 From: Todd Wolfson Date: Sat, 13 Apr 2013 16:35:25 -0700 Subject: [PATCH 7/9] Moving back to see testling is the problem o_o --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 638039dcc..779da0942 100644 --- a/package.json +++ b/package.json @@ -44,14 +44,13 @@ ], "harness": "mocha-tdd", "browsers": [ - "ie/10..latest", + "ie/6..latest", "chrome/20..latest", "chrome/canary", "firefox/10..latest", "firefox/nightly", "safari/latest", - "opera/11.6", - "opera/12.0", + "opera/11.0..latest", "opera/next", "iphone/6", "ipad/6" From dc5f6c9dabb32ac471112c9ad61f34ae4dde8bbd Mon Sep 17 00:00:00 2001 From: Todd Wolfson Date: Sun, 14 Apr 2013 16:02:22 -0700 Subject: [PATCH 8/9] Reverting IE10 test patch for single purpose PRs --- test/expect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/expect.js b/test/expect.js index d06e0bca3..01b142d27 100644 --- a/test/expect.js +++ b/test/expect.js @@ -702,7 +702,7 @@ suite('expect', function () { err(function(){ expect(2).to.satisfy(matcher, 'blah'); - }, /blah: expected 2 to satisfy \[Function: matcher\s*\]/); + }, "blah: expected 2 to satisfy [Function: matcher]"); }); test('closeTo', function(){ From c1534efeffdac83be0b511597d211479aa2a3de4 Mon Sep 17 00:00:00 2001 From: Todd Wolfson Date: Sun, 14 Apr 2013 18:06:06 -0700 Subject: [PATCH 9/9] Testing testling-ci reboot