Skip to content

Commit bdc3de3

Browse files
committed
Add connection timeout example
1 parent fbcf676 commit bdc3de3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/v1/examples.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,21 @@ describe('examples', () => {
124124
};
125125
});
126126

127+
it('config connection timeout example', done => {
128+
// tag::config-connection-timeout[]
129+
const driver = neo4j.driver(uri, neo4j.auth.basic(user, password),
130+
{
131+
connectionTimeout: 20 * 1000, // 20 seconds
132+
}
133+
);
134+
// end::config-connection-timeout[]
135+
136+
driver.onCompleted = () => {
137+
driver.close();
138+
done();
139+
};
140+
});
141+
127142
it('config load balancing example', done => {
128143
// tag::config-load-balancing-strategy[]
129144
const driver = neo4j.driver(uri, neo4j.auth.basic(user, password),

0 commit comments

Comments
 (0)