-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate [DubDownloads] into one service
Same idea as #3318.
- Loading branch information
1 parent
483ecf2
commit de9ff46
Showing
2 changed files
with
89 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
'use strict' | ||
|
||
const Joi = require('joi') | ||
const { ServiceTester } = require('../tester') | ||
const { isMetric, isMetricOverTimePeriod } = require('../test-validators') | ||
const t = (module.exports = require('../tester').createServiceTester()) | ||
|
||
const isDownloadsColor = Joi.equal( | ||
'red', | ||
|
@@ -12,11 +12,6 @@ const isDownloadsColor = Joi.equal( | |
'brightgreen' | ||
) | ||
|
||
const t = (module.exports = new ServiceTester({ | ||
id: 'dub', | ||
title: 'DubDownloads', | ||
})) | ||
|
||
t.create('total downloads (valid)') | ||
.get('/dt/vibe-d.json') | ||
.expectBadge({ | ||
|
@@ -29,7 +24,7 @@ t.create('total downloads, specific version (valid)') | |
.get('/dt/vibe-d/0.8.4.json') | ||
.expectBadge({ | ||
label: '[email protected]', | ||
message: Joi.string().regex(/^[1-9][0-9]*[kMGTPEZY]?$/), | ||
message: isMetric, | ||
color: isDownloadsColor, | ||
}) | ||
.timeout(15000) | ||
|
@@ -38,7 +33,7 @@ t.create('total downloads, latest version (valid)') | |
.get('/dt/vibe-d/latest.json') | ||
.expectBadge({ | ||
label: 'downloads@latest', | ||
message: Joi.string().regex(/^[1-9][0-9]*[kMGTPEZY]?$/), | ||
message: isMetric, | ||
color: isDownloadsColor, | ||
}) | ||
|
||
|