From 0dadcdf942c184e7bc0679f3e2c28c75def1bfaa Mon Sep 17 00:00:00 2001 From: kahnjw Date: Mon, 27 Apr 2015 08:52:55 -0700 Subject: [PATCH] Factor out Q.noConflict test This commit factors out the Q.noConflict test into two tests, each with one assertion. There is one test for node environments and another for browser environments where Q is used as a global. --- spec/q-spec.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/q-spec.js b/spec/q-spec.js index 2a15b361..ce47ef18 100644 --- a/spec/q-spec.js +++ b/spec/q-spec.js @@ -2509,7 +2509,11 @@ describe("browser support", function () { // In this context the original value of Q is undefined Q.noConflict(); expect(Q).toEqual(undefined); - } else { + } + }); + + it("throws an error if Q.noConflict is called in node", function () { + if (typeof window === 'undefined') { // If window is undefined the tests are being run in node, and // Q.noConflict should throw an error expect(Q.noConflict).toThrow();