1 | import {expect} from 'chai';
|
2 | import Pg from '../src/index';
|
3 |
|
4 | describe('pg-async driver', () => {
|
5 | it('should be `pg` module by default', () => {
|
6 | expect(new Pg().getDriver()).to.be.equal(require('pg'));
|
7 | });
|
8 |
|
9 | it('should be `pg` module by if "pg" string used', () => {
|
10 | expect(new Pg(null, '').getDriver()).to.be.equal(require('pg'));
|
11 | expect(new Pg(null, 'pg').getDriver()).to.be.equal(require('pg'));
|
12 | });
|
13 |
|
14 | it('should be `pg.native` module by if "native" string used', () => {
|
15 | expect(new Pg(null, 'native').getDriver()).to.be.equal(require('pg').native);
|
16 | expect(new Pg(null, 'pg.native').getDriver()).to.be.equal(require('pg').native);
|
17 | });
|
18 |
|
19 | it('should throw if unknown driver used', () => {
|
20 | expect(() => new Pg(null, 'horse')).to.throw(Error);
|
21 | });
|
22 | });
|