This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
/
upload.test.js
79 lines (73 loc) · 2.06 KB
/
upload.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
var fs = require('fs')
// var codecov = require('../lib/codecov')
// var offlineErrors = require('../lib/offline')
describe('Codecov', function() {
beforeEach(function() {
try {
fs.unlinkSync('report.tmp')
} catch (e) {}
})
afterAll(function() {
try {
fs.unlinkSync('report.tmp')
} catch (e) {}
})
it('passes', function(done) {
done()
})
/*
thomasrockhu - 2020-08-20
These tests are flaky and fail intermittently. Commenting them out until we fix some infrastructure work on the Codecov side.
it('can get upload to v2', function(done) {
var self = this
codecov.sendToCodecovV2(
'https://codecov.io',
{
token: 'f881216b-b5c0-4eb1-8f21-b51887d1d506',
commit: 'c739768fcac68144a3a6d82305b9c4106934d31a',
branch: 'master',
},
'testing node-' + codecov.version,
function(body) {
expect(body).toContain(
'https://codecov.io/github/codecov/ci-repo/commit/c739768fcac68144a3a6d82305b9c4106934d31a'
)
done()
},
function(errCode, errMsg) {
if (offlineErrors.indexOf(errCode) !== -1) {
self.skip() // offline - we can not test upload
return
}
throw new Error(errMsg)
}
)
})
it('can get upload to v4', function(done) {
var self = this
jest.setTimeout(10000) // give this test extra time to run (default is 2000ms)
codecov.sendToCodecovV4(
'https://codecov.io',
{
token: 'f881216b-b5c0-4eb1-8f21-b51887d1d506',
commit: 'c739768fcac68144a3a6d82305b9c4106934d31a',
branch: 'master',
},
'testing node-' + codecov.version,
function(body) {
expect(body).toContain(
'https://codecov.io/github/codecov/ci-repo/commit/c739768fcac68144a3a6d82305b9c4106934d31a'
)
done()
},
function(errCode, errMsg) {
if (offlineErrors.indexOf(errCode) !== -1) {
self.skip() // offline - we can not test upload
return
}
throw new Error(errMsg)
}
)
})
**/
})