forked from kaiwood/pnut-butter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexplore_test.js
49 lines (41 loc) · 1.28 KB
/
explore_test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const chai = require("chai");
const chaiAsPromised = require("chai-as-promised");
const nock = require("nock");
chai.use(chaiAsPromised);
chai.should();
const pnut = require("../lib/pnut");
before(function() {
let base = "https://api.pnut.io/v0";
nock(base)
.get("/posts/streams/explore")
.reply(200, {});
nock(base)
.get("/posts/streams/explore/conversations")
.reply(200, {});
nock(base)
.get("/posts/streams/explore/photos")
.reply(200, {});
nock(base)
.get("/posts/streams/explore/trending")
.reply(200, {});
nock(base)
.get("/posts/streams/explore/missed_conversations")
.reply(200, {});
});
describe("Explore", () => {
it("should be able to fetch the explore endpoint", () => {
return pnut.explore().should.become({});
});
it("should be able to fetch the 'explore conversations' stream", () => {
return pnut.conversations().should.become({});
});
it("should be able to fetch the 'explore photos' stream", () => {
return pnut.photos().should.become({});
});
it("should be able to fetch the 'explore trending' stream", () => {
return pnut.trending().should.become({});
});
it("should be able to fetch the 'missed conversations' stream", () => {
return pnut.missedConversations().should.become({});
});
});