File tree Expand file tree Collapse file tree 2 files changed +47
-1
lines changed
Expand file tree Collapse file tree 2 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 22
33jSQL (Official) - Version 3.0.0 - * Now available without a prescription!*
44
5- [ ![ npm version] ( https://badge.fury.io/js/jsql-official.svg )] ( https://badge.fury.io/js/jsql-official ) [ ![ Build Status] ( https://travis-ci.org/Pamblam/jSQL.svg?branch=master )] ( https://travis-ci.org/Pamblam/jSQL ) [ ![ Inline docs] ( http://inch-ci.org/github/Pamblam/jSQL.svg?branch=master )] ( http ://inch-ci.org/ github/Pamblam/jSQL)
5+ [ ![ npm version] ( https://badge.fury.io/js/jsql-official.svg )] ( https://badge.fury.io/js/jsql-official ) [ ![ Build Status] ( https://travis-ci.org/Pamblam/jSQL.svg?branch=master )] ( https://travis-ci.org/Pamblam/jSQL ) [ ![ Inline docs] ( http://inch-ci.org/github/Pamblam/jSQL.svg?branch=master )] ( https ://github.com/Pamblam/jSQL/wiki ) [ ![ Code Climate ] ( https://codeclimate.com/ github/Pamblam/jSQL/badges/gpa.svg )] ( https://codeclimate.com/github/Pamblam/jSQL ) [ ![ Coverage Status ] ( https://coveralls.io/repos/github/Pamblam/jSQL/badge.svg?branch=master )] ( https://coveralls.io/github/Pamblam/jSQL?branch=master )
66
77<hr >
88
Original file line number Diff line number Diff line change 1+ var expect = require ( 'chai' ) . expect ;
2+ var jSQL = require ( "../jSQL.js" ) ;
3+
4+
5+ jSQL . load ( function ( ) {
6+ jSQL . reset ( ) ;
7+ describe ( 'ERROR tests' , function ( ) {
8+
9+ it ( 'Testing Error 0001' , function ( ) {
10+ jSQL . query ( "create table myfunct (f function, id int)" ) . execute ( ) ;
11+ var q = jSQL . query ( "insert into myfunct values (?)" ) ;
12+ var e_ = false ;
13+ try {
14+ q . execute ( [ "not a function" ] ) ;
15+ } catch ( e ) {
16+ e_ = e . error === "0001" ;
17+ }
18+ expect ( e_ ) . to . be . true ;
19+ } ) ;
20+
21+ it ( 'Testing Lexer Error' , function ( ) {
22+ var e_ = false ;
23+ try {
24+ jSQL . query ( "hi im bob ~~~~``~~~``~`~" ) . execute ( ) ;
25+ q . execute ( ) ;
26+ } catch ( e ) {
27+ console . log ( e . toString ( ) ) ;
28+ e_ = true ;
29+ }
30+ expect ( e_ ) . to . be . true ;
31+ } ) ;
32+
33+ it ( 'Testing Parser Error' , function ( ) {
34+ var e_ = false ;
35+ try {
36+ jSQL . query ( "hi im bob" ) . execute ( ) ;
37+ q . execute ( ) ;
38+ } catch ( e ) {
39+ console . log ( e . toString ( ) ) ;
40+ e_ = true ;
41+ }
42+ expect ( e_ ) . to . be . true ;
43+ } ) ;
44+
45+ } ) ;
46+ } ) ;
You can’t perform that action at this time.
0 commit comments