File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 27
27
"homepage" : " https://github.com/cemremengu/fastify-oracle#readme" ,
28
28
"devDependencies" : {
29
29
"coveralls" : " ^3.0.2" ,
30
- "fastify" : " ^1.1.0 " ,
30
+ "fastify" : " ^1.11.1 " ,
31
31
"pre-commit" : " ^1.2.2" ,
32
32
"snazzy" : " ^8.0.0" ,
33
33
"standard" : " ^12.0.1" ,
Original file line number Diff line number Diff line change 2
2
3
3
const test = require ( 'tap' ) . test
4
4
const plugin = require ( '../plugin' )
5
+ const Fastify = require ( 'fastify' )
5
6
6
7
test ( 'creates pool from config' , ( t ) => {
7
8
t . plan ( 6 )
@@ -88,3 +89,23 @@ test('creates named pool from config', (t) => {
88
89
. catch ( t . threw )
89
90
} )
90
91
} )
92
+
93
+ test ( 'duplicate connection names should throw' , ( t ) => {
94
+ t . plan ( 1 )
95
+
96
+ const fastify = Fastify ( )
97
+
98
+ const opts = {
99
+ user : 'travis' ,
100
+ password : 'travis' ,
101
+ connectString : 'localhost/xe'
102
+ }
103
+
104
+ fastify
105
+ . register ( plugin , { pool : opts , name : 'testdb' } )
106
+ . register ( plugin , { pool : opts , name : 'testdb' } )
107
+
108
+ fastify . ready ( err => {
109
+ t . is ( err . message , 'Connection name has already been registered: testdb' )
110
+ } )
111
+ } )
You can’t perform that action at this time.
0 commit comments