Skip to content

Commit

Permalink
Factor out Q.noConflict test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kahnvex committed Apr 27, 2015
1 parent 9b3e0b2 commit 0dadcdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/q-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0dadcdf

Please sign in to comment.