-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
github-pipenv.tester.js
91 lines (80 loc) · 2.45 KB
/
github-pipenv.tester.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
80
81
82
83
84
85
86
87
88
89
90
91
import Joi from 'joi'
import { ServiceTester } from '../tester.js'
import {
isVPlusDottedVersionAtLeastOne,
isVPlusDottedVersionNClausesWithOptionalSuffix,
} from '../test-validators.js'
// e.g. v19.3b0
const isBlackVersion = Joi.string().regex(/^v\d+(\.\d+)*(.*)?$/)
const isShortSha = Joi.string().regex(/[0-9a-f]{7}/)
export const t = new ServiceTester({
id: 'GithubPipenv',
title: 'GithubPipenv',
pathPrefix: '/github/pipenv',
})
t.create('Locked Python version')
.get('/locked/python-version/metabolize/rq-dashboard-on-heroku.json')
.expectBadge({
label: 'python',
message: isVPlusDottedVersionAtLeastOne,
})
t.create('Locked Python version (no pipfile.lock)')
.get('/locked/python-version/metabolize/react-flexbox-svg.json')
.expectBadge({
label: 'python',
message: 'repo not found, branch not found, or Pipfile.lock missing',
})
t.create('Locked Python version (pipfile.lock has no python version)')
.get('/locked/python-version/fikovnik/ShiftIt.json')
.expectBadge({
label: 'python',
message: 'version not specified',
})
t.create('Locked version of default dependency')
.get(
'/locked/dependency-version/metabolize/rq-dashboard-on-heroku/rq-dashboard.json'
)
.expectBadge({
label: 'rq-dashboard',
message: isVPlusDottedVersionNClausesWithOptionalSuffix,
})
t.create('Locked version of default dependency (branch)')
.get(
'/locked/dependency-version/metabolize/rq-dashboard-on-heroku/rq-dashboard/master.json'
)
.expectBadge({
label: 'rq-dashboard',
message: isVPlusDottedVersionNClausesWithOptionalSuffix,
})
t.create('Locked version of dev dependency')
.get(
'/locked/dependency-version/metabolize/rq-dashboard-on-heroku/dev/black.json'
)
.expectBadge({
label: 'black',
message: isBlackVersion,
})
t.create('Locked version of dev dependency (branch)')
.get(
'/locked/dependency-version/metabolize/rq-dashboard-on-heroku/dev/black/master.json'
)
.expectBadge({
label: 'black',
message: isBlackVersion,
})
t.create('Locked version of unknown dependency')
.get(
'/locked/dependency-version/metabolize/rq-dashboard-on-heroku/dev/i-made-this-up.json'
)
.expectBadge({
label: 'dependency',
message: 'dev dependency not found',
})
t.create('Locked version of VCS dependency')
.get(
'/locked/dependency-version/DemocracyClub/aggregator-api/dc-base-theme.json'
)
.expectBadge({
label: 'dc-base-theme',
message: isShortSha,
})