@@ -5,15 +5,16 @@ import { Neo4jContainer, Neo4jPlugin } from "./neo4j-container";
55const IMAGE = getImage ( __dirname ) ;
66
77describe ( "Neo4jContainer" , { timeout : 180_000 } , ( ) => {
8- // createNode {
98 it ( "should create a person node" , async ( ) => {
9+ // createNode {
1010 await using container = await new Neo4jContainer ( IMAGE ) . start ( ) ;
11+
1112 const driver = neo4j . driver (
1213 container . getBoltUri ( ) ,
1314 neo4j . auth . basic ( container . getUsername ( ) , container . getPassword ( ) )
1415 ) ;
15-
1616 const session = driver . session ( ) ;
17+
1718 const personName = "Chris" ;
1819 const result = await session . run ( "CREATE (a:Person {name: $name}) RETURN a" , { name : personName } ) ;
1920 const singleRecord = result . records [ 0 ] ;
@@ -22,8 +23,8 @@ describe("Neo4jContainer", { timeout: 180_000 }, () => {
2223
2324 await session . close ( ) ;
2425 await driver . close ( ) ;
26+ // }
2527 } ) ;
26- // }
2728
2829 // v5DefaultPassword {
2930 it ( "should connect to neo4j:v5 with default password" , async ( ) => {
@@ -45,13 +46,15 @@ describe("Neo4jContainer", { timeout: 180_000 }, () => {
4546 } ) ;
4647 // }
4748
48- // setPassword {
4949 it ( "should connect with custom password" , async ( ) => {
50+ // setPassword {
5051 await using container = await new Neo4jContainer ( IMAGE ) . withPassword ( "xyz1234@!" ) . start ( ) ;
52+
5153 const driver = neo4j . driver (
5254 container . getBoltUri ( ) ,
5355 neo4j . auth . basic ( container . getUsername ( ) , container . getPassword ( ) )
5456 ) ;
57+ // }
5558
5659 const session = driver . session ( ) ;
5760 const personName = "Chris" ;
@@ -63,32 +66,33 @@ describe("Neo4jContainer", { timeout: 180_000 }, () => {
6366 await session . close ( ) ;
6467 await driver . close ( ) ;
6568 } ) ;
66- // }
6769
68- // apoc {
6970 it ( "should have APOC plugin installed" , async ( ) => {
71+ // apoc {
7072 await using container = await new Neo4jContainer ( IMAGE ) . withApoc ( ) . withStartupTimeout ( 120_000 ) . start ( ) ;
73+
7174 const driver = neo4j . driver (
7275 container . getBoltUri ( ) ,
7376 neo4j . auth . basic ( container . getUsername ( ) , container . getPassword ( ) )
7477 ) ;
75-
7678 const session = driver . session ( ) ;
79+
7780 const result = await session . run ( "CALL apoc.help('text')" ) ;
7881 const singleRecord = result . records [ 0 ] ;
7982 expect ( singleRecord . length ) . toBeGreaterThan ( 0 ) ;
83+ // }
8084
8185 await session . close ( ) ;
8286 await driver . close ( ) ;
8387 } ) ;
84- // }
8588
86- // pluginsList {
8789 it ( "should work with plugin list" , async ( ) => {
90+ // pluginsList {
8891 await using container = await new Neo4jContainer ( "neo4j:5.26.5" )
8992 . withPlugins ( [ Neo4jPlugin . APOC_EXTENDED , Neo4jPlugin . GRAPH_DATA_SCIENCE ] )
9093 . withStartupTimeout ( 120_000 )
9194 . start ( ) ;
95+
9296 const driver = neo4j . driver (
9397 container . getBoltUri ( ) ,
9498 neo4j . auth . basic ( container . getUsername ( ) , container . getPassword ( ) )
@@ -109,6 +113,6 @@ describe("Neo4jContainer", { timeout: 180_000 }, () => {
109113
110114 await session . close ( ) ;
111115 await driver . close ( ) ;
116+ // }
112117 } ) ;
113- // }
114118} ) ;
0 commit comments