@@ -7,47 +7,41 @@ import { ReadPreference } from '../../src/read_preference';
7
7
describe ( 'class Db' , function ( ) {
8
8
describe ( 'secondaryOk' , function ( ) {
9
9
const client = new MongoClient ( 'mongodb://localhost:27017' ) ;
10
- const legacy_secondary_ok = 'slaveOk' ;
11
10
const secondary_ok = 'secondaryOk' ;
12
11
13
12
it ( 'should be false when readPreference is Primary' , function ( ) {
14
13
const options : DbOptions = { readPreference : ReadPreference . PRIMARY } ;
15
14
const mydb = new Db ( client , 'mydb' , options ) ;
16
15
17
16
expect ( mydb ) . property ( secondary_ok ) . to . be . false ;
18
- expect ( mydb ) . property ( legacy_secondary_ok ) . to . be . false ;
19
17
} ) ;
20
18
21
19
it ( 'should be true when readPreference is Primary Preferred' , function ( ) {
22
20
const options : DbOptions = { readPreference : ReadPreference . PRIMARY_PREFERRED } ;
23
21
const mydb = new Db ( client , 'mydb' , options ) ;
24
22
25
23
expect ( mydb ) . property ( secondary_ok ) . to . be . true ;
26
- expect ( mydb ) . property ( legacy_secondary_ok ) . to . be . true ;
27
24
} ) ;
28
25
29
26
it ( 'should be true when readPreference is Secondary' , function ( ) {
30
27
const options : DbOptions = { readPreference : ReadPreference . SECONDARY } ;
31
28
const mydb = new Db ( client , 'mydb' , options ) ;
32
29
33
30
expect ( mydb ) . property ( secondary_ok ) . to . be . true ;
34
- expect ( mydb ) . property ( legacy_secondary_ok ) . to . be . true ;
35
31
} ) ;
36
32
37
33
it ( 'should be true when readPreference is Secondary Preferred' , function ( ) {
38
34
const options : DbOptions = { readPreference : ReadPreference . SECONDARY_PREFERRED } ;
39
35
const mydb = new Db ( client , 'mydb' , options ) ;
40
36
41
37
expect ( mydb ) . property ( secondary_ok ) . to . be . true ;
42
- expect ( mydb ) . property ( legacy_secondary_ok ) . to . be . true ;
43
38
} ) ;
44
39
45
40
it ( 'should be true when readPreference is Nearest' , function ( ) {
46
41
const options : DbOptions = { readPreference : ReadPreference . NEAREST } ;
47
42
const mydb = new Db ( client , 'mydb' , options ) ;
48
43
49
44
expect ( mydb ) . property ( secondary_ok ) . to . be . true ;
50
- expect ( mydb ) . property ( legacy_secondary_ok ) . to . be . true ;
51
45
} ) ;
52
46
} ) ;
53
47
} ) ;
0 commit comments