forked from abhijeetps/weekly-digest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.test.js
33 lines (28 loc) · 923 Bytes
/
index.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
const { Application } = require('probot');
const createScheduler = require('probot-scheduler');
const { SCHEDULE_REPOSITORY_EVENT } = require('./src/bin/constants');
const myProbotApp = require('.');
describe.skip('My Probot app', () => {
let app;
let github;
beforeEach(() => {
app = new Application();
app.load(myProbotApp);
github = {
issues: {
createLabel: jest.fn().mockReturnValue(Promise.resolve({})),
},
};
app.auth = () => Promise.resolve(github);
createScheduler(app);
});
it(`initCreateWeeklyDigest to have been called when it receives ${SCHEDULE_REPOSITORY_EVENT}`, async () => {
const initCreateWeeklyDigest = jest.fn();
await app.receive({
event: SCHEDULE_REPOSITORY_EVENT,
});
expect(initCreateWeeklyDigest).toHaveBeenCalled();
});
});
// For more information about testing with Jest see:
// https://facebook.github.io/jest/