diff --git a/services/bstats/bstats-players.service.js b/services/bstats/bstats-players.service.js index 393bfb50bee86..d2966f725d6aa 100644 --- a/services/bstats/bstats-players.service.js +++ b/services/bstats/bstats-players.service.js @@ -1,6 +1,7 @@ 'use strict' const BaseJsonService = require('../base-json') +const { metric } = require('../../lib/text-formatters') const Joi = require('joi') const schema = Joi.array() @@ -49,7 +50,7 @@ module.exports = class BStatsPlayers extends BaseJsonService { static render({ players }) { return { - message: players, + message: metric(players), } } diff --git a/services/bstats/bstats-players.tester.js b/services/bstats/bstats-players.tester.js index e74890abf9aa1..a43b53cc45ff5 100644 --- a/services/bstats/bstats-players.tester.js +++ b/services/bstats/bstats-players.tester.js @@ -1,6 +1,7 @@ 'use strict' const Joi = require('joi') +const { isMetric } = require('../test-validators') const t = (module.exports = require('../create-service-tester')()) @@ -9,6 +10,6 @@ t.create('Players') .expectJSONTypes( Joi.object().keys({ name: 'players', - value: Joi.number(), + value: isMetric, }) ) diff --git a/services/bstats/bstats-servers.service.js b/services/bstats/bstats-servers.service.js index 2cdb9b45153b0..d47b4cf7ac80b 100644 --- a/services/bstats/bstats-servers.service.js +++ b/services/bstats/bstats-servers.service.js @@ -1,6 +1,7 @@ 'use strict' const BaseJsonService = require('../base-json') +const { metric } = require('../../lib/text-formatters') const Joi = require('joi') const schema = Joi.array() @@ -49,7 +50,7 @@ module.exports = class BStatsServers extends BaseJsonService { static render({ servers }) { return { - message: servers, + message: metric(servers), } } diff --git a/services/bstats/bstats-servers.tester.js b/services/bstats/bstats-servers.tester.js index 69daf9393efa3..803db610afc45 100644 --- a/services/bstats/bstats-servers.tester.js +++ b/services/bstats/bstats-servers.tester.js @@ -1,6 +1,7 @@ 'use strict' const Joi = require('joi') +const { isMetric } = require('../test-validators') const t = (module.exports = require('../create-service-tester')()) @@ -9,6 +10,6 @@ t.create('Servers') .expectJSONTypes( Joi.object().keys({ name: 'servers', - value: Joi.number(), + value: isMetric, }) )