@@ -6,27 +6,26 @@ import { CassandraContainer } from "./cassandra-container";
66const IMAGE = getImage ( __dirname ) ;
77
88describe . sequential ( "Cassandra" , { timeout : 240_000 } , ( ) => {
9- // connectWithDefaultCredentials {
109 it ( "should connect and execute a query with default credentials" , async ( ) => {
10+ // connectWithDefaultCredentials {
1111 await using container = await new CassandraContainer ( IMAGE ) . start ( ) ;
1212
1313 const client = new Client ( {
1414 contactPoints : [ container . getContactPoint ( ) ] ,
1515 localDataCenter : container . getDatacenter ( ) ,
1616 keyspace : "system" ,
1717 } ) ;
18-
1918 await client . connect ( ) ;
2019
2120 const result = await client . execute ( "SELECT release_version FROM system.local" ) ;
2221 expect ( result . rows [ 0 ] . release_version ) . toBe ( ImageName . fromString ( IMAGE ) . tag ) ;
2322
2423 await client . shutdown ( ) ;
24+ // }
2525 } ) ;
26- // }
2726
28- // connectWithCustomCredentials {
2927 it ( "should connect with custom username and password" , async ( ) => {
28+ // connectWithCustomCredentials {
3029 const username = "testUser" ;
3130 const password = "testPassword" ;
3231
@@ -38,6 +37,7 @@ describe.sequential("Cassandra", { timeout: 240_000 }, () => {
3837 credentials : { username, password } ,
3938 keyspace : "system" ,
4039 } ) ;
40+ // }
4141
4242 await client . connect ( ) ;
4343
@@ -46,12 +46,12 @@ describe.sequential("Cassandra", { timeout: 240_000 }, () => {
4646
4747 await client . shutdown ( ) ;
4848 } ) ;
49- // }
5049
51- // customDataCenterAndRack {
5250 it ( "should set datacenter and rack" , async ( ) => {
51+ // customDataCenterAndRack {
5352 const customDataCenter = "customDC" ;
5453 const customRack = "customRack" ;
54+
5555 await using container = await new CassandraContainer ( IMAGE )
5656 . withDatacenter ( customDataCenter )
5757 . withRack ( customRack )
@@ -61,15 +61,15 @@ describe.sequential("Cassandra", { timeout: 240_000 }, () => {
6161 contactPoints : [ container . getContactPoint ( ) ] ,
6262 localDataCenter : container . getDatacenter ( ) ,
6363 } ) ;
64-
6564 await client . connect ( ) ;
65+
6666 const result = await client . execute ( "SELECT data_center, rack FROM system.local" ) ;
6767 expect ( result . rows [ 0 ] . data_center ) . toBe ( customDataCenter ) ;
6868 expect ( result . rows [ 0 ] . rack ) . toBe ( customRack ) ;
6969
7070 await client . shutdown ( ) ;
71+ // }
7172 } ) ;
72- // }
7373
7474 // createAndFetchData {
7575 it ( "should create keyspace, a table, insert data, and retrieve it" , async ( ) => {
0 commit comments