tests: fix spigetdownloadsize service test (#7018)
This commit is contained in:
@@ -2,16 +2,16 @@ import { isFileSize } from '../test-validators.js'
|
||||
import { createServiceTester } from '../tester.js'
|
||||
export const t = await createServiceTester()
|
||||
|
||||
t.create('EssentialsX (id 9089)')
|
||||
.get('/9089.json')
|
||||
t.create('EssentialsX (hosted resource)')
|
||||
.get('/771.json')
|
||||
.expectBadge({ label: 'size', message: isFileSize })
|
||||
|
||||
t.create('Pet Master (id 15904)').get('/15904.json').expectBadge({
|
||||
t.create('Pet Master (external resource)').get('/15904.json').expectBadge({
|
||||
lavel: 'size',
|
||||
message: 'resource hosted externally',
|
||||
})
|
||||
|
||||
t.create('Invalid Resource (id 1)').get('/1.json').expectBadge({
|
||||
t.create('Invalid Resource').get('/1.json').expectBadge({
|
||||
label: 'size',
|
||||
message: 'not found',
|
||||
})
|
||||
|
||||
@@ -93,7 +93,9 @@ const isPercentage = Joi.alternatives().try(
|
||||
isDecimalPercentage
|
||||
)
|
||||
|
||||
const isFileSize = withRegex(/^[0-9]*[.]?[0-9]+\s(B|kB|MB|GB|TB|PB|EB|ZB|YB)$/)
|
||||
const isFileSize = withRegex(
|
||||
/^[0-9]*[.]?[0-9]+\s(B|kB|KB|MB|GB|TB|PB|EB|ZB|YB)$/
|
||||
)
|
||||
|
||||
const isFormattedDate = Joi.alternatives().try(
|
||||
Joi.equal('today', 'yesterday'),
|
||||
|
||||
Reference in New Issue
Block a user