@@ -217,10 +217,7 @@ describe('getPrintableShardStatus', function () {
217217 configDatabase . getSiblingDB = getSiblingDB ;
218218 configDatabase . _maybeCachedHello = stub ( ) . returns ( { msg : 'isdbgrid' } ) ;
219219
220- const status = await getPrintableShardStatus (
221- configDatabase . _typeLaunder ( ) ,
222- false
223- ) ;
220+ const status = await getPrintableShardStatus ( configDatabase , false ) ;
224221 expect ( status . shardingVersion . clusterId ) . to . be . instanceOf ( bson . ObjectId ) ;
225222 expect ( status . shards . map ( ( { host } : { host : string } ) => host ) ) . to . include (
226223 'shard01/localhost:27018,localhost:27019,localhost:27020'
@@ -251,10 +248,7 @@ describe('getPrintableShardStatus', function () {
251248 'upgradeState' ,
252249 ] ) {
253250 it ( `does not show ${ hiddenField } in shardingVersion` , async function ( ) {
254- const status = await getPrintableShardStatus (
255- configDatabase . _typeLaunder ( ) ,
256- false
257- ) ;
251+ const status = await getPrintableShardStatus ( configDatabase , false ) ;
258252 expect ( ( status . shardingVersion as any ) [ hiddenField ] ) . to . equal (
259253 undefined
260254 ) ;
@@ -265,28 +259,19 @@ describe('getPrintableShardStatus', function () {
265259 it ( 'returns whether the balancer is currently running' , async function ( ) {
266260 {
267261 inBalancerRound = true ;
268- const status = await getPrintableShardStatus (
269- configDatabase . _typeLaunder ( ) ,
270- true
271- ) ;
262+ const status = await getPrintableShardStatus ( configDatabase , true ) ;
272263 expect ( status . balancer [ 'Currently running' ] ) . to . equal ( 'yes' ) ;
273264 }
274265
275266 {
276267 inBalancerRound = false ;
277- const status = await getPrintableShardStatus (
278- configDatabase . _typeLaunder ( ) ,
279- true
280- ) ;
268+ const status = await getPrintableShardStatus ( configDatabase , true ) ;
281269 expect ( status . balancer [ 'Currently running' ] ) . to . equal ( 'no' ) ;
282270 }
283271 } ) ;
284272
285273 it ( 'returns an object with verbose sharding information if requested' , async function ( ) {
286- const status = await getPrintableShardStatus (
287- configDatabase . _typeLaunder ( ) ,
288- true
289- ) ;
274+ const status = await getPrintableShardStatus ( configDatabase , true ) ;
290275 expect ( ( status [ 'most recently active mongoses' ] [ 0 ] as any ) . up ) . to . be . a (
291276 'number'
292277 ) ;
@@ -300,10 +285,7 @@ describe('getPrintableShardStatus', function () {
300285 _id : 'balancer' ,
301286 activeWindow : { start : '00:00' , stop : '23:59' } ,
302287 } ) ;
303- const status = await getPrintableShardStatus (
304- configDatabase . _typeLaunder ( ) ,
305- false
306- ) ;
288+ const status = await getPrintableShardStatus ( configDatabase , false ) ;
307289 expect ( status . balancer [ 'Balancer active window is set between' ] ) . to . equal (
308290 '00:00 and 23:59 server local time'
309291 ) ;
@@ -319,10 +301,7 @@ describe('getPrintableShardStatus', function () {
319301 what : 'balancer.round' ,
320302 ns : '' ,
321303 } ) ;
322- const status = await getPrintableShardStatus (
323- configDatabase . _typeLaunder ( ) ,
324- false
325- ) ;
304+ const status = await getPrintableShardStatus ( configDatabase , false ) ;
326305 expect (
327306 status . balancer [ 'Failed balancer rounds in last 5 attempts' ]
328307 ) . to . equal ( 1 ) ;
@@ -336,10 +315,7 @@ describe('getPrintableShardStatus', function () {
336315 ts : new bson . ObjectId ( '5fce116c579db766a198a176' ) ,
337316 when : new Date ( '2020-12-07T11:26:36.803Z' ) ,
338317 } ) ;
339- const status = await getPrintableShardStatus (
340- configDatabase . _typeLaunder ( ) ,
341- false
342- ) ;
318+ const status = await getPrintableShardStatus ( configDatabase , false ) ;
343319 expect (
344320 status . balancer [ 'Collections with active migrations' ]
345321 ) . to . have . lengthOf ( 1 ) ;
@@ -354,10 +330,7 @@ describe('getPrintableShardStatus', function () {
354330 what : 'moveChunk.from' ,
355331 details : { from : 'shard0' , to : 'shard1' , note : 'success' } ,
356332 } ) ;
357- const status = await getPrintableShardStatus (
358- configDatabase . _typeLaunder ( ) ,
359- false
360- ) ;
333+ const status = await getPrintableShardStatus ( configDatabase , false ) ;
361334 expect (
362335 status . balancer [ 'Migration Results for the last 24 hours' ]
363336 ) . to . deep . equal ( { 1 : 'Success' } ) ;
@@ -369,10 +342,7 @@ describe('getPrintableShardStatus', function () {
369342 what : 'moveChunk.from' ,
370343 details : { from : 'shard0' , to : 'shard1' , errmsg : 'oopsie' } ,
371344 } ) ;
372- const status = await getPrintableShardStatus (
373- configDatabase . _typeLaunder ( ) ,
374- false
375- ) ;
345+ const status = await getPrintableShardStatus ( configDatabase , false ) ;
376346
377347 expect (
378348 status . balancer [ 'Migration Results for the last 24 hours' ]
@@ -382,7 +352,7 @@ describe('getPrintableShardStatus', function () {
382352 it ( 'fails when config.version is empty' , async function ( ) {
383353 await configDatabase . getCollection ( 'version' ) . drop ( ) ;
384354 try {
385- await getPrintableShardStatus ( configDatabase . _typeLaunder ( ) , false ) ;
355+ await getPrintableShardStatus ( configDatabase , false ) ;
386356 } catch ( err : any ) {
387357 expect ( err . name ) . to . equal ( 'MongoshInvalidInputError' ) ;
388358 return ;
0 commit comments