From b5609e05c64db6bb7719f4d445cfe967ff1d8375 Mon Sep 17 00:00:00 2001 From: christianalfoni Date: Tue, 19 Nov 2013 18:05:10 +0100 Subject: [PATCH 1/3] Added fix to throwError --- .idea/encodings.xml | 5 +++++ .idea/expect.js.iml | 9 +++++++++ .idea/misc.xml | 5 +++++ .idea/modules.xml | 9 +++++++++ .idea/scopes/scope_settings.xml | 5 +++++ .idea/vcs.xml | 7 +++++++ expect.js | 6 +++--- 7 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 .idea/encodings.xml create mode 100644 .idea/expect.js.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/scopes/scope_settings.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..e206d70 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/.idea/expect.js.iml b/.idea/expect.js.iml new file mode 100644 index 0000000..6b8184f --- /dev/null +++ b/.idea/expect.js.iml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..1162f43 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..cb34fbf --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..c80f219 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/expect.js b/expect.js index 7d47e95..4c0ed47 100644 --- a/expect.js +++ b/expect.js @@ -161,9 +161,9 @@ thrown = true; } - if (isRegExp(fn) && not) { - // in the presence of a matcher, ensure the `not` only applies to - // the matching. + if (thrown && not && isRegExp(fn)) { + // in the presence of a matcher and an error actually is thrown, + // ensure the `not` only applies to the matching. this.flags.not = false; } From e2d1d7ef1b672a6a8a196b30e24f614fe3238654 Mon Sep 17 00:00:00 2001 From: christianalfoni Date: Tue, 19 Nov 2013 18:07:17 +0100 Subject: [PATCH 2/3] Removed .idea files --- .idea/encodings.xml | 5 ----- .idea/expect.js.iml | 9 --------- .idea/misc.xml | 5 ----- .idea/modules.xml | 9 --------- .idea/scopes/scope_settings.xml | 5 ----- .idea/vcs.xml | 7 ------- 6 files changed, 40 deletions(-) delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/expect.js.iml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/scopes/scope_settings.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index e206d70..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.idea/expect.js.iml b/.idea/expect.js.iml deleted file mode 100644 index 6b8184f..0000000 --- a/.idea/expect.js.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 1162f43..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index cb34fbf..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b..0000000 --- a/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index c80f219..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - From ff36485b3b41879646528b88ae512334518e2d4c Mon Sep 17 00:00:00 2001 From: christianalfoni Date: Tue, 25 Feb 2014 06:58:07 +0100 Subject: [PATCH 3/3] Added test file for error bug --- test/expect.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/expect.js b/test/expect.js index 7b24cdf..5d6d508 100644 --- a/test/expect.js +++ b/test/expect.js @@ -143,6 +143,7 @@ describe('expect', function () { expect(itThrowsString).to.throwException(/aaa/); expect(itThrowsString).to.not.throwException(/bbb/); + expect(itWorks).to.not.throwException(/ccc/); err(function () { expect(itThrowsString).to.throwException(/no match/i);