handle missing statistics array in [VisualStudioMarketplace] badges (#8985)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
@@ -16,7 +16,7 @@ const extensionQuerySchema = Joi.object({
|
||||
value: Joi.number().required(),
|
||||
})
|
||||
)
|
||||
.required(),
|
||||
.default([]),
|
||||
versions: Joi.array()
|
||||
.items(
|
||||
Joi.object({
|
||||
|
||||
@@ -101,6 +101,35 @@ t.create('zero installs')
|
||||
color: 'red',
|
||||
})
|
||||
|
||||
t.create('missing statistics array')
|
||||
.get('/visual-studio-marketplace/i/swellaby.rust-pack.json')
|
||||
.intercept(nock =>
|
||||
nock('https://marketplace.visualstudio.com/_apis/public/gallery/')
|
||||
.post('/extensionquery/')
|
||||
.reply(200, {
|
||||
results: [
|
||||
{
|
||||
extensions: [
|
||||
{
|
||||
versions: [
|
||||
{
|
||||
version: '1.0.0',
|
||||
},
|
||||
],
|
||||
releaseDate: '2019-04-13T07:50:27.000Z',
|
||||
lastUpdated: '2019-04-13T07:50:27.000Z',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
})
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'installs',
|
||||
message: '0',
|
||||
color: 'red',
|
||||
})
|
||||
|
||||
t.create('downloads')
|
||||
.get('/visual-studio-marketplace/d/swellaby.rust-pack.json')
|
||||
.intercept(nock =>
|
||||
|
||||
Reference in New Issue
Block a user