-
Notifications
You must be signed in to change notification settings - Fork 1
/
twitter-bot.spec.js
40 lines (32 loc) · 1.15 KB
/
twitter-bot.spec.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
const TwitterBot = require('./twitter-bot.js');
const Twit = require('twit');
// Smoke Tests
describe('Smoke Tests', () => {
describe('Bot', () => {
it('should exists as object', () => {
expect(typeof TwitterBot.Bot).toBe('object');
});
it('should be instance of Twit', () => {
expect(TwitterBot.Bot).toBeInstanceOf(Twit);
});
it('should Bot config have twitter access properties', () => {
const expected = {
consumer_key: expect.anything(),
consumer_secret: expect.anything(),
access_token: expect.anything(),
access_token_secret: expect.anything(),
};
expect(TwitterBot.Bot.config).toEqual(expect.objectContaining(expected))
});
});
describe('BotRetweet', () => {
it('should BotRetweet exist and be a function', () => {
expect(typeof TwitterBot.BotRetweet).toBe('function');
});
});
describe('isReply', () => {
it('should exist and be a function', () => {
expect(typeof TwitterBot.isReply).toBe('function');
});
});
})