forked from WCOMAB/KuduPostDeploymentSlackHook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
51 lines (49 loc) · 1.64 KB
/
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
var http = require('http');
var testOptions = {
host: 'localhost',
port: process.env.port || 1337,
path: '/',
method: 'POST',
headers: { 'Content-Type': 'application/json' }
};
var jsonTests = [
JSON.stringify({
"id": "2bdc42572263361fef1a3334c562be57dfb06c27",
"status": "success",
"statusText": "",
"authorEmail": "[email protected]",
"author": "John Doe",
"message": "Epic new feature!",
"progress": "",
"deployer": "",
"receivedTime": "2015-06-11T09:58:46.9983824Z",
"startTime": "2015-06-11T10:39:02.1322211Z",
"endTime": "2015-06-11T10:39:07.555094Z",
"lastSuccessEndTime": "2015-06-11T10:39:07.555094Z",
"complete": true,
"siteName": "azure-dummy-site"
}),
JSON.stringify({
"id": "2bdc42572263361fef1a3334c562be57dfb06c27",
"status": "failure",
"statusText": "",
"authorEmail": "[email protected]",
"author": "John Doe",
"message": "Epic failure!",
"progress": "",
"deployer": "",
"receivedTime": "2015-06-11T09:58:46.9983824Z",
"startTime": "2015-06-11T10:39:02.1322211Z",
"endTime": "2015-06-11T10:39:07.555094Z",
"lastSuccessEndTime": "2015-06-11T10:39:07.555094Z",
"complete": false,
"siteName": "azure-dummy-site"
})
];
jsonTests.forEach(function(testJson){
var req = http.request(testOptions, function(res) {
console.log(res.statusCode);
});
req.write(testJson);
req.end();
});