forked from kaiwood/pnut-butter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstream_markers_test.js
52 lines (45 loc) · 1017 Bytes
/
stream_markers_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
50
51
52
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)
.post("/markers", [
{
name: "channel:18",
id: 15100
}
])
.reply(200, {});
nock(base)
.post("/markers", [
{
name: "channel:18",
id: 15100
},
{
name: "channel:19",
id: 15101
}
])
.reply(200, {});
});
after(function() {
nock.cleanAll();
});
describe("Stream markers", () => {
it("should be able to update a single stream marker", () => {
return pnut.marker("channel:18", 15100).should.become({});
});
it("should be able to update a multiple stream markers", () => {
return pnut
.markers([
{ name: "channel:18", id: 15100 },
{ name: "channel:19", id: 15101 }
])
.should.become({});
});
});