Skip to content

Commit d29b5bd

Browse files
committed
fix node.js/tests/test.js to be compatible with web-based mocha test runner
1 parent ef1c7e2 commit d29b5bd

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

node.js/tests/test.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
var PUBNUB = require('../pubnub.js'),
2-
assert = require('assert'),
3-
_ = require("underscore"),
4-
nock = require('nock');
1+
if (typeof window == 'undefined') {
2+
var PUBNUB = require('../pubnub.js'),
3+
assert = require('assert'),
4+
_ = require("underscore"),
5+
nock = require('nock');
6+
}
57

68
var pubnub = PUBNUB.init({
79
publish_key: 'ds',
@@ -63,7 +65,9 @@ describe('Pubnub', function () {
6365
this.timeout(180000);
6466

6567
before(function () {
66-
nock.enableNetConnect();
68+
if (nock) {
69+
nock.enableNetConnect();
70+
}
6771

6872
pubnub.channel_group_list_groups({
6973
callback: function (r) {

0 commit comments

Comments
 (0)