File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ class PoolPlus extends Pool {
92
92
*/
93
93
defineTable ( name , schema , migrationStrategy ) {
94
94
if ( typeof name !== 'string' ) {
95
- throw new Error ( 'The table name must be a string' ) ;
95
+ throw new TypeError ( 'The table name must be a string' ) ;
96
96
}
97
97
if ( this . _tables . has ( name ) ) {
98
98
throw new Error ( `A table called "${ name } " has already been defined for this pool` ) ;
Original file line number Diff line number Diff line change @@ -103,7 +103,8 @@ describe('PoolPlus', () => {
103
103
} ) ;
104
104
105
105
it ( 'should throw if the table name is not a string' , ( ) => {
106
- should . throws ( ( ) => pool . defineTable ( / t a b l e / ) , / T h e t a b l e n a m e m u s t b e a s t r i n g / ) ;
106
+ ( ( ) => pool . defineTable ( / t a b l e / ) ) . should . throw ( TypeError ) ;
107
+ ( ( ) => pool . defineTable ( / t a b l e / ) ) . should . throw ( / T h e t a b l e n a m e m u s t b e a s t r i n g / ) ;
107
108
} ) ;
108
109
109
110
it ( 'should throw if no columns are provided' , ( ) => {
You can’t perform that action at this time.
0 commit comments