generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev-test.js
42 lines (38 loc) · 1000 Bytes
/
dev-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
// eslint-disable-next-line import/no-extraneous-dependencies
require('dotenv').config();
const runCronicleJob = require('./src/runCronicleJob');
const main = async () => {
// test simple
// see jobs/job#1.sh
await runCronicleJob({
cronicleHost: process.env.CRONICLE_HOST,
eventId: process.env.EVENT_ID,
apiKey: process.env.API_KEY,
fetchInterval: 5,
maxFetchRetries: 100,
failRegex: null,
});
// test regex
// see jobs/job#2.sh
await runCronicleJob({
cronicleHost: process.env.CRONICLE_HOST,
eventId: process.env.EVENT_ID2,
apiKey: process.env.API_KEY,
fetchInterval: 5,
maxFetchRetries: 100,
failRegex: 'Status Code: 1',
});
// test parameters + regex
// see jobs/job#3.sh
await runCronicleJob({
cronicleHost: process.env.CRONICLE_HOST,
eventId: process.env.EVENT_ID3,
apiKey: process.env.API_KEY,
failRegex: `First:\\s*$`,
parameters: {
param1: 'one',
param2: 'two',
},
});
};
main();