From 6a75b8f1d8f8eb7a4af2b190dbe06d13d5b4ea80 Mon Sep 17 00:00:00 2001 From: Igor Shapiro Date: Tue, 6 Jun 2017 12:47:27 -0700 Subject: [PATCH] Workaround https://github.com/domenic/chai-as-promised/issues/198 until https://github.com/domenic/chai-as-promised/pull/157 is merged. --- CHANGELOG.md | 5 +++++ examples/app/test/some_test.js | 9 +++++++++ package.json | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88864a75..4850ae8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.6.9 + +- Workaround the chai-as-promised w/chai-4.0 issue +- Fix job crash on error + ## 0.6.8 - Moved http, framework and services tests to respective directories diff --git a/examples/app/test/some_test.js b/examples/app/test/some_test.js index 329da199..81e5a154 100644 --- a/examples/app/test/some_test.js +++ b/examples/app/test/some_test.js @@ -3,6 +3,15 @@ describe('Hello', function() { expect(2).to.equal(2) }) + describe('chai-as-promised', function() { + it('detects rejection', async function() { + let start = Date.now() + let promise = Promise.delay(100).throw('Error') + await expect(promise).to.be.rejectedWith('Error') + expect(Date.now() - start).to.be.gte(99) + }) + }) + it('works with promises', async function() { let start = Date.now() await Promise.delay(100) diff --git a/package.json b/package.json index c4ac1ae6..49399edd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "quadro", - "version": "0.6.8", + "version": "0.6.9", "keywords": [ "framework", "quadro", @@ -22,7 +22,7 @@ "bunyan": "^1.8.10", "bunyan-logstash-tcp": "^1.0.0", "chai": "^4.0.0", - "chai-as-promised": "^6.0.0", + "chai-as-promised": "meeber/chai-as-promised#chai-issue-723", "chai-subset": "^1.5.0", "co": "^4.6.0", "colors": "^1.1.2",