8000 OAuth tests: Increase Event Emitter max listeners · jublo/codebird-js@4e79fb0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4e79fb0

Browse files
committed
OAuth tests: Increase Event Emitter max listeners
1 parent 02854f5 commit 4e79fb0

File tree

1 file changed

+53
-48
lines changed

1 file changed

+53
-48
lines changed

test/oauth_tests.js

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,104 @@
1+
require("events").EventEmitter.defaultMaxListeners = 15;
2+
13
const tape = require("tape"),
24
_test = require("tape-promise"),
35
test = _test(tape), // decorate tape
46
CodebirdM = require("./codebirdm");
57

68
function getCB() {
7-
var cb = new CodebirdM.default;
9+
var cb = new CodebirdM.default();
810
cb.setConsumerKey("123", "456");
911

1012
return cb;
1113
}
1214

13-
test("Tests oauth_authenticate Promise", function (t) {
15+
test("Tests oauth_authenticate Promise", function(t) {
1416
const cb = getCB();
1517
t.plan(1);
1618

1719
cb.setToken("123", "456");
18-
return cb.oauth_authenticate().then(function (a) {
19-
t.deepEqual(
20-
a,
21-
{reply: "https://api.twitter.com/oauth/authenticate?oauth_token=123"}
22-
)
20+
return cb.oauth_authenticate().then(function(a) {
21+
t.deepEqual(a, {
22+
reply: "https://api.twitter.com/oauth/authenticate?oauth_token=123"
23+
});
2324
});
2425
});
2526

26-
test("Tests oauth_authenticate callback", function (t) {
27+
test("Tests oauth_authenticate callback", function(t) {
2728
const cb = getCB();
2829
t.plan(4);
2930

3031
cb.setToken("123", "456");
31-
cb.oauth_authenticate({}, function (a) {
32-
t.equal(
33-
a, "https://api.twitter.com/oauth/authenticate?oauth_token=123"
34-
)
32+
cb.oauth_authenticate({}, function(a) {
33+
t.equal(a, "https://api.twitter.com/oauth/authenticate?oauth_token=123");
3534
});
36-
cb.oauth_authenticate({force_login: true}, function (a) {
35+
cb.oauth_authenticate({ force_login: true }, function(a) {
3736
t.equal(
38-
a, "https://api.twitter.com/oauth/authenticate?oauth_token=123&force_login=1"
39-
)
40-
});
41-
cb.oauth_authenticate({force_login: true, screen_name: "TwitterAPI"}, function (a) {
42-
t.equal(
43-
a, "https://api.twitter.com/oauth/authenticate?oauth_token=123&force_login=1&screen_name=TwitterAPI"
44-
)
37+
a,
38+
"https://api.twitter.com/oauth/authenticate?oauth_token=123&force_login=1"
39+
);
4540
});
46-
cb.oauth_authenticate({screen_name: "TwitterAPI"}, function (a) {
41+
cb.oauth_authenticate(
42+
{ force_login: true, screen_name: "TwitterAPI" },
43+
function(a) {
44+
t.equal(
45+
a,
46+
"https://api.twitter.com/oauth/authenticate?oauth_token=123&force_login=1&screen_name=TwitterAPI"
47+
);
48+
}
49+
);
50+
cb.oauth_authenticate({ screen_name: "TwitterAPI" }, function(a) {
4751
t.equal(
48-
a, "https://api.twitter.com/oauth/authenticate?oauth_token=123&screen_name=TwitterAPI"
49-
)
52+
a,
53+
"https://api.twitter.com/oauth/authenticate?oauth_token=123&screen_name=TwitterAPI"
54+
);
5055
});
5156
});
5257

53-
test("Tests oauth_authorize callback", function (t) {
58+
test("Tests oauth_authorize callback", function(t) {
5459
const cb = getCB();
5560
t.plan(4);
5661

5762
cb.setToken("123", "456");
58-
cb.oauth_authorize({}, function (a) {
59-
t.equal(
60-
a, "https://api.twitter.com/oauth/authorize?oauth_token=123"
61-
)
63+
cb.oauth_authorize({}, function(a) {
64+
t.equal(a, "https://api.twitter.com/oauth/authorize?oauth_token=123");
6265< 8000 div class="diff-text-inner"> });
63-
cb.oauth_authorize({force_login: true}, function (a) {
66+
cb.oauth_authorize({ force_login: true }, function(a) {
6467
t.equal(
65-
a, "https://api.twitter.com/oauth/authorize?oauth_token=123&force_login=1"
66-
)
68+
a,
69+
"https://api.twitter.com/oauth/authorize?oauth_token=123&force_login=1"
70+
);
6771
});
68-
cb.oauth_authorize({force_login: true, screen_name: "TwitterAPI"}, function (a) {
72+
cb.oauth_authorize({ force_login: true, screen_name: "TwitterAPI" }, function(
73+
a
74+
) {
6975
t.equal(
70-
a, "https://api.twitter.com/oauth/authorize?oauth_token=123&force_login=1&screen_name=TwitterAPI"
71-
)
76+
a,
77+
"https://api.twitter.com/oauth/authorize?oauth_token=123&force_login=1&screen_name=TwitterAPI"
78+
);
7279
});
73-
cb.oauth_authorize({screen_name: "TwitterAPI"}, function (a) {
80+
cb.oauth_authorize({ screen_name: "TwitterAPI" }, function(a) {
7481
t.equal(
75-
a, "https://api.twitter.com/oauth/authorize?oauth_token=123&screen_name=TwitterAPI"
76-
)
82+
a,
83+
"https://api.twitter.com/oauth/authorize?oauth_token=123&screen_name=TwitterAPI"
84+
);
7785
});
7886
});
7987

80-
test("Tests oauth2_token", function (t) {
88+
test("Tests oauth2_token", function(t) {
8189
const cb = getCB();
8290
t.plan(1);
8391

84-
cb.oauth2_token(
85-
function (a) {
86-
t.deepEqual(
87-
a, {
88-
token_type: "bearer",
89-
access_token: "VqiO0n2HrKE",
90-
httpstatus: 200
91-
}
92-
);
92+
cb.oauth2_token(function(a) {
93+
t.deepEqual(a, {
94+
token_type: "bearer",
95+
access_token: "VqiO0n2HrKE",
96+
httpstatus: 200
9397
});
98+
});
9499
});
95100

96-
test("Tests signing of boolean parameters", function (t) {
101+
test("Tests signing of boolean parameters", function(t) {
97102
const cb = getCB();
98103

99104
t.equal(

0 commit comments

Comments
 (0)
0