1
1
'use strict' ;
2
2
3
3
var expect = require ( 'chai' ) . expect ,
4
- f = require ( 'util' ) . format ,
5
4
fs = require ( 'fs' ) ,
5
+ p = require ( 'path' ) ,
6
6
ReplSetState = require ( '../../../lib/core/topologies/replset_state' ) ,
7
7
MongoError = require ( '../../../lib/core/error' ) . MongoError ,
8
8
ReadPreference = require ( '../../../lib/core/topologies/read_preference' ) ;
@@ -18,17 +18,17 @@ describe('A replicaset with no primary', function() {
18
18
19
19
test : function ( done ) {
20
20
const config = this . configuration ;
21
- var path = f (
22
- '%s/../spec/server-selection/server_selection/ReplicaSetNoPrimary/read' ,
23
- __dirname
21
+ var path = p . resolve (
22
+ __dirname ,
23
+ '../../spec/server-selection/server_selection/ReplicaSetNoPrimary/read'
24
24
) ;
25
25
var entries = fs . readdirSync ( path ) . filter ( function ( x ) {
26
26
return x . indexOf ( '.json' ) !== - 1 ;
27
27
} ) ;
28
28
29
29
// Execute each of the entries
30
30
entries . forEach ( function ( x ) {
31
- executeEntry ( config , x , f ( '%s/%s' , path , x ) ) ;
31
+ executeEntry ( config , x , ` ${ path } / ${ x } ` ) ;
32
32
} ) ;
33
33
34
34
done ( ) ;
@@ -47,17 +47,18 @@ describe('A replicaset with a primary', function() {
47
47
48
48
test : function ( done ) {
49
49
const config = this . configuration ;
50
- var path = f (
51
- '%s/../spec/server-selection/server_selection/ReplicaSetWithPrimary/read' ,
52
- __dirname
50
+ var path = p . resolve (
51
+ __dirname ,
52
+ '../../spec/server-selection/server_selection/ReplicaSetWithPrimary/read'
53
53
) ;
54
+
54
55
var entries = fs . readdirSync ( path ) . filter ( function ( x ) {
55
56
return x . indexOf ( '.json' ) !== - 1 ;
56
57
} ) ;
57
58
58
59
// Execute each of the entries
59
60
entries . forEach ( function ( x ) {
60
- executeEntry ( config , x , f ( '%s/%s' , path , x ) ) ;
61
+ executeEntry ( config , x , ` ${ path } / ${ x } ` ) ;
61
62
} ) ;
62
63
63
64
done ( ) ;
0 commit comments