Browse Source

Update dependencies, and fix linting issues

keep-around/4064a99419461bccaf062953d2fcfb38503fbc65
Timothy Warren 1 year ago
parent
commit
a94038cd47

+ 3
- 2
.eslintrc View File

@@ -34,5 +34,6 @@
34 34
 		"callback-return": [1],
35 35
 		"object-shorthand": [1, "methods"],
36 36
 		"prefer-template": [1]
37
-	}
38
-}
37
+	},
38
+	"parser": "babel-eslint"
39
+}

+ 0
- 2
lib/Adapter.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 /**
4 2
  * Class that wraps database connection libraries
5 3
  *

+ 0
- 2
lib/Driver.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 const Helpers = require('./Helpers');
4 2
 
5 3
 /**

+ 0
- 2
lib/Helpers.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 const fs = require('fs');
4 2
 
5 3
 /**

+ 0
- 2
lib/NodeQuery.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 const QueryBuilder = require('./QueryBuilder');
4 2
 
5 3
 // Map config driver name to code class name

+ 0
- 2
lib/QueryBuilder.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 const Helpers = require('./Helpers');
4 2
 const QueryBuilderBase = require('./QueryBuilderBase');
5 3
 

+ 4
- 2
lib/QueryBuilderBase.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 const Helpers = require('./Helpers');
4 2
 const QueryParser = require('./QueryParser');
5 3
 const State = require('./State');
@@ -127,6 +125,10 @@ class QueryBuilderBase {
127 125
 	 * when appending to state
128 126
 	 *
129 127
 	 * @private
128
+	 * @param {mixed} letName Lorem Ipsum
129
+	 * @param {mixed} valType Lorem Ipsum
130
+	 * @param {mixed} key Lorem Ipsum
131
+	 * @param {mixed} val Lorem Ipsum
130 132
 	 * @return {Array} - modified state array
131 133
 	 */
132 134
 	_mixedSet (letName, valType, key, val) {

+ 1
- 3
lib/QueryParser.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 const XRegExp = require('xregexp');
4 2
 const Helpers = require('./Helpers');
5 3
 
@@ -35,7 +33,7 @@ class QueryParser {
35 33
 					${matchPatterns['function'].source}|
36 34
 					${matchPatterns.literal.source}
37 35
 				)
38
-				([a-z_\-]+[0-9]*\\.?)
36
+				([a-z_-]+[0-9]*\\.?)
39 37
 			)+`, 'igx');
40 38
 
41 39
 		// Full pattern for determining ordering of the pieces

+ 1
- 3
lib/Result.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 const Helpers = require('./Helpers');
4 2
 
5 3
 /**
@@ -16,7 +14,7 @@ class Result {
16 14
 	 * @param {Array} [rows] - the data rows of the result
17 15
 	 * @param {Array} [columns] - the column names in the result
18 16
 	 */
19
-	constructor (rows=[], columns=[]) {
17
+	constructor (rows = [], columns = []) {
20 18
 		this._rows = rows;
21 19
 		this._columns = columns;
22 20
 

+ 0
- 2
lib/State.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 /**
4 2
  * Class for objects containing the query builder state
5 3
  * @private

+ 0
- 8
lib/adapters/Firebird/index.js View File

@@ -1,8 +0,0 @@
1
-'use strict';
2
-
3
-const NodeFirebird = require('./node-firebird');
4
-
5
-module.exports = config => {
6
-	return new NodeFirebird(config.connection);
7
-};
8
-

+ 0
- 61
lib/adapters/Firebird/node-firebird.js View File

@@ -1,61 +0,0 @@
1
-'use strict';
2
-
3
-const Adapter = require('../../Adapter');
4
-const Result = require('../../Result');
5
-const fb = require('node-firebird');
6
-
7
-class Firebird extends Adapter {
8
-	constructor (config) {
9
-		super({});
10
-		this.instance = new Promise((resolve, reject) => {
11
-			fb.attach(config, (err, instance) => {
12
-				if (err) {
13
-					return reject(err);
14
-				}
15
-
16
-				return resolve(instance);
17
-			});
18
-		});
19
-	}
20
-
21
-	/**
22
-	 * Run the sql query as a prepared statement
23
-	 *
24
-	 * @param {String} sql - The sql with placeholders
25
-	 * @param {Array} params - The values to insert into the query
26
-	 * @return {Promise} - Returns a promise if no callback is provided
27
-	 */
28
-	execute (sql, params) {
29
-		return this.instance.then(conn => {
30
-			return new Promise((resolve, reject) => {
31
-				conn.query(sql, params, (err, result) => {
32
-					if (err) {
33
-						return reject(err);
34
-					}
35
-
36
-					return resolve(this.transformResult(result));
37
-				});
38
-			});
39
-		});
40
-	}
41
-
42
-	/**
43
-	 * Transform the adapter's result into a standard format
44
-	 *
45
-	 * @param {*} originalResult - the original result object from the driver
46
-	 * @return {Result} - the new result object
47
-	 */
48
-	transformResult (originalResult) {
49
-		return new Result(originalResult);
50
-	}
51
-
52
-	/**
53
-	 * Close the current database connection
54
-	 * @return {void}
55
-	 */
56
-	close () {
57
-		this.instance.then(conn => conn.detach());
58
-	}
59
-}
60
-
61
-module.exports = Firebird;

+ 0
- 2
lib/adapters/MariaDB/index.js View File

@@ -1,3 +1 @@
1
-'use strict';
2
-
3 1
 module.exports = require('../Mysql');

+ 0
- 2
lib/adapters/Mysql/index.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 const Mysql2 = require('./mysql2');
4 2
 
5 3
 module.exports = config => {

+ 0
- 3
lib/adapters/Mysql/mysql2.js View File

@@ -1,12 +1,9 @@
1
-'use strict';
2
-
3 1
 const Adapter = require('../../Adapter');
4 2
 const Result = require('../../Result');
5 3
 const Helpers = require('../../Helpers');
6 4
 const mysql2 = require('mysql2/promise');
7 5
 
8 6
 class Mysql extends Adapter {
9
-
10 7
 	constructor (config) {
11 8
 		const instance = mysql2.createConnection(config);
12 9
 		super(instance);

+ 0
- 2
lib/adapters/Pg/Pg.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 const Adapter = require('../../Adapter');
4 2
 const Result = require('../../Result');
5 3
 const Helpers = require('../../Helpers');

+ 2
- 5
lib/adapters/Pg/PgNative.js View File

@@ -1,9 +1,5 @@
1
-'use strict';
2
-
3 1
 const Pg = require('./Pg');
4
-const Result = require('../../Result');
5 2
 const pg = require('pg').native;
6
-const url = require('url');
7 3
 
8 4
 class PgNative extends Pg {
9 5
 	constructor (config) {
@@ -21,7 +17,8 @@ class PgNative extends Pg {
21 17
 
22 18
 			instance = Promise.resolve(conn);
23 19
 		}
24
-		super(instance);
20
+
21
+		super.instance = instance;
25 22
 	}
26 23
 }
27 24
 

+ 1
- 3
lib/adapters/Pg/index.js View File

@@ -1,7 +1,5 @@
1
-'use strict';
2
-
3 1
 const Pg = require('./Pg');
4
-const PgNative = require('./PgNative')
2
+const PgNative = require('./PgNative');
5 3
 
6 4
 module.exports = config => {
7 5
 	return (config.native)

+ 0
- 2
lib/adapters/Sqlite/dblite.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 const Adapter = require('../../Adapter');
4 2
 const Result = require('../../Result');
5 3
 const Helpers = require('../../Helpers');

+ 0
- 3
lib/adapters/Sqlite/index.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 module.exports = config => {
4 2
 	const Implementation = (config.native)
5 3
 		? require('./sqlite3')
@@ -7,4 +5,3 @@ module.exports = config => {
7 5
 
8 6
 	return new Implementation(config.connection);
9 7
 };
10
-

+ 0
- 2
lib/adapters/Sqlite/sqlite3.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 const Adapter = require('../../Adapter');
4 2
 const Result = require('../../Result');
5 3
 const Helpers = require('../../Helpers');

+ 0
- 45
lib/drivers/Firebird.js View File

@@ -1,45 +0,0 @@
1
-'use strict';
2
-
3
-let Helpers = require('../Helpers');
4
-
5
-/**
6
- * Driver for Firebird databases
7
- *
8
- * @module drivers/firebird
9
- */
10
-module.exports = (() => {
11
-	delete require.cache[require.resolve('../Driver')];
12
-	let driver = require('../Driver');
13
-
14
-	driver.hasTruncate = false;
15
-
16
-	/**
17
-	 * Set the limit clause
18
-
19
-	 * @param {String} origSql - SQL statement to modify
20
-	 * @param {Number} limit - Maximum number of rows to fetch
21
-	 * @param {Number|null} offset - Number of rows to skip
22
-	 * @return {String} - Modified SQL statement
23
-	 */
24
-	driver.limit = (origSql, limit, offset) => {
25
-		let sql = `FIRST ${limit}`;
26
-
27
-		if (Helpers.isNumber(offset)) {
28
-			sql += ` SKIP ${offset}`;
29
-		}
30
-
31
-		return origSql.replace(/SELECT/i, `SELECT ${sql}`);
32
-	};
33
-
34
-	/**
35
-	 * SQL to insert a group of rows
36
-	 *
37
-	 * @return {void}
38
-	 * @throws {Error}
39
-	 */
40
-	driver.insertBatch = () => {
41
-		throw new Error('Not Implemented');
42
-	};
43
-
44
-	return driver;
45
-})();

+ 0
- 2
lib/drivers/MariaDB.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 /**
4 2
  * Driver for MariaDB databases
5 3
  *

+ 0
- 2
lib/drivers/Mysql.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 /**
4 2
  * Driver for MySQL databases
5 3
  *

+ 0
- 2
lib/drivers/Pg.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 /**
4 2
  * Driver for PostgreSQL databases
5 3
  *

+ 0
- 2
lib/drivers/Sqlite.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 /**
4 2
  * Driver for SQLite databases
5 3
  *

+ 100
- 94
package.json View File

@@ -1,96 +1,102 @@
1 1
 {
2
-  "name": "ci-node-query",
3
-  "version": "5.0.0",
4
-  "description": "A query builder for node based on the one in CodeIgniter",
5
-  "author": "Timothy J Warren <tim@timshomepage.net>",
6
-  "engines": {
7
-    "node": ">=6.0.0"
8
-  },
9
-  "files": [
10
-    "lib/"
11
-  ],
12
-  "contributors": [
13
-    {
14
-      "name": "Timothy J Warren",
15
-      "email": "tim@timshomepage.net"
16
-    }
17
-  ],
18
-  "repository": {
19
-    "type": "git",
20
-    "url": "https://git.timshomepage.net/timw4mail/node-query.git"
21
-  },
22
-  "keywords": [
23
-    "codeigniter",
24
-    "mariadb",
25
-    "mysql",
26
-    "mssql",
27
-    "query builder",
28
-    "postgres",
29
-    "postgresql",
30
-    "sql",
31
-    "sqlite",
32
-    "sqlite3",
33
-    "sqlserver"
34
-  ],
35
-  "bugs": {
36
-    "url": "https://git.timshomepage.net/timw4mail/node-query/issues"
37
-  },
38
-  "main": "lib/NodeQuery.js",
39
-  "dependencies": {
40
-    "dblite": "^0.7.8",
41
-    "getargs": "~0.0.8",
42
-    "glob": "^7.0.3",
43
-    "mysql2": "^1.2.0",
44
-    "node-firebird": "^0.8.1",
45
-    "pg": "^6.1.2",
46
-    "require-reload": "~0.2.2",
47
-    "sqlite3": "^3.1.8",
48
-    "tedious": "^1.14.0",
49
-    "xregexp": "^3.0.0"
50
-  },
51
-  "devDependencies": {
52
-    "chai": "^3.5.0",
53
-    "chai-as-promised": "^6.0.0",
54
-    "documentation": "latest",
55
-    "eslint": "^3.5.0",
56
-    "globstar": "^1.0.0",
57
-    "happiness": "^7.1.2",
58
-    "jest": "^19.0.2",
59
-    "jsdoc": "^3.4.3",
60
-    "npm-run-all": "^4.0.2",
61
-    "nsp": "^2.2.1"
62
-  },
63
-  "license": "MIT",
64
-  "jest": {
65
-    "coverageDirectory": "coverage",
66
-    "coverageReporters": [
67
-      "html",
68
-      "json",
69
-      "lcov",
70
-      "text-summary"
71
-    ],
72
-    "testEnvironment": "node",
73
-    "testMatch": [
74
-      "**/test/**/*_test.js"
75
-    ]
76
-  },
77
-  "scripts": {
78
-    "audit": "nsp check",
79
-    "build": "npm-run-all --parallel lint:src lint:tests docs coverage",
80
-    "coverage": "jest --coverage",
81
-    "default": "npm-run-all --parallel audit lint:src lint:tests && npm run test",
82
-    "predocs": "globstar -- documentation build -f md -o API.md \"lib/*.js\"",
83
-    "docs": "globstar -- documentation build -f html -o docs \"lib/*.js\"",
84
-    "postdocs": "jsdoc lib -r -d documentation",
85
-    "happy": "happiness \"lib/**/*.js\" \"test/**/*.js\"",
86
-    "happy:src": "happiness \"lib/**/*.js\"",
87
-    "happy:tests": "happiness \"test/**/*.js\"",
88
-    "lint": "npm-run-all lint:tests lint:src happy",
89
-    "lint:src": "eslint ./lib",
90
-    "lint:tests": "eslint ./test",
91
-    "test": "jest"
92
-  },
93
-  "peerDependencies": {
94
-    "pg-native": "^1.10.0"
95
-  }
2
+	"name": "ci-node-query",
3
+	"version": "6.0.0",
4
+	"description": "A query builder for node based on the one in CodeIgniter",
5
+	"author": "Timothy J Warren <tim@timshomepage.net>",
6
+	"engines": {
7
+		"node": ">=8.0.0"
8
+	},
9
+	"files": [
10
+		"lib/"
11
+	],
12
+	"contributors": [
13
+		{
14
+			"name": "Timothy J Warren",
15
+			"email": "tim@timshomepage.net"
16
+		}
17
+	],
18
+	"repository": {
19
+		"type": "git",
20
+		"url": "https://git.timshomepage.net/timw4mail/node-query.git"
21
+	},
22
+	"keywords": [
23
+		"codeigniter",
24
+		"mariadb",
25
+		"mysql",
26
+		"mssql",
27
+		"query builder",
28
+		"postgres",
29
+		"postgresql",
30
+		"sql",
31
+		"sqlite",
32
+		"sqlite3",
33
+		"sqlserver"
34
+	],
35
+	"bugs": {
36
+		"url": "https://git.timshomepage.net/timw4mail/node-query/issues"
37
+	},
38
+	"main": "lib/NodeQuery.js",
39
+	"dependencies": {
40
+		"dblite": "^0.8.0",
41
+		"getargs": "~0.0.8",
42
+		"glob": "^7.0.3",
43
+		"mysql2": "^1.2.0",
44
+		"pg": "^7.4",
45
+		"require-reload": "~0.2.2",
46
+		"sqlite3": "^3.1.8",
47
+		"tedious": "^2.0.0",
48
+		"xregexp": "^4.0.0"
49
+	},
50
+	"devDependencies": {
51
+		"babel-eslint": "^8.2.1",
52
+		"chai": "^4.1",
53
+		"chai-as-promised": "^7.1",
54
+		"documentation": "latest",
55
+		"eslint": "^4.16.0",
56
+		"globstar": "^1.0.0",
57
+		"happiness": "^10.0",
58
+		"jest": "^22.0.0",
59
+		"jsdoc": "^3.4.3",
60
+		"npm-run-all": "^4.0.2",
61
+		"nsp": "^3.1",
62
+		"pg-native": "^2.2"
63
+	},
64
+	"license": "MIT",
65
+	"jest": {
66
+		"coverageDirectory": "coverage",
67
+		"coverageReporters": [
68
+			"html",
69
+			"json",
70
+			"lcov",
71
+			"text-summary"
72
+		],
73
+		"testEnvironment": "node",
74
+		"testMatch": [
75
+			"**/test/**/*_test.js"
76
+		]
77
+	},
78
+	"scripts": {
79
+		"audit": "nsp check",
80
+		"build": "npm-run-all --parallel lint:src lint:tests docs coverage",
81
+		"coverage": "jest --coverage",
82
+		"default": "npm-run-all --parallel audit lint:src lint:tests && npm run test",
83
+		"predocs": "globstar -- documentation build -f md -o API.md \"lib/*.js\"",
84
+		"docs": "globstar -- documentation build -f html -o docs \"lib/*.js\"",
85
+		"fix": "happiness --fix \"lib/**/*.js\" \"test/**/*.js\"",
86
+		"postdocs": "jsdoc lib -r -d documentation",
87
+		"happy": "happiness \"lib/**/*.js\" \"test/**/*.js\"",
88
+		"happy:src": "happiness \"lib/**/*.js\"",
89
+		"happy:tests": "happiness \"test/**/*.js\"",
90
+		"lint": "npm-run-all lint:tests lint:src happy",
91
+		"lint:src": "eslint ./lib",
92
+		"lint:tests": "eslint ./test",
93
+		"test": "jest"
94
+	},
95
+	"happiness": {
96
+		"env": {
97
+			"es6": true,
98
+			"jest": true
99
+		},
100
+		"parser": "babel-eslint"
101
+	}
96 102
 }

BIN
test/FB_TEST_DB.FDB View File


+ 6
- 10
test/adapters/dblite_test.js View File

@@ -1,11 +1,7 @@
1
-/* eslint-env node, mocha */
2
-'use strict';
3
-
4 1
 // Load the test base
5 2
 const reload = require('require-reload')(require);
6 3
 reload.emptyCache();
7 4
 const testBase = reload('../base');
8
-const expect = testBase.expect;
9 5
 const testRunner = testBase.promiseTestRunner;
10 6
 
11 7
 // Load the test config file
@@ -23,15 +19,15 @@ describe('Dblite adapter tests -', () => {
23 19
 	});
24 20
 
25 21
 	testRunner(qb);
26
-	it('Promise - Select with function and argument in WHERE clause', () => {
27
-		let promise = qb.select('id')
22
+	it('Promise - Select with function and argument in WHERE clause', async () => {
23
+		let promise = await qb.select('id')
28 24
 			.from('create_test')
29 25
 			.where('id', 'ABS(-88)')
30 26
 			.get();
31 27
 
32
-		expect(promise).to.be.fulfilled;
28
+		expect(promise).toEqual(expect.anything());
33 29
 	});
34
-	it('Promise - Test Insert Batch', () => {
30
+	it('Promise - Test Insert Batch', async () => {
35 31
 		let data = [
36 32
 			{
37 33
 				id: 544,
@@ -48,8 +44,8 @@ describe('Dblite adapter tests -', () => {
48 44
 			}
49 45
 		];
50 46
 
51
-		let promise = qb.insertBatch('create_test', data);
52
-		expect(promise).to.be.fulfilled;
47
+		let promise = await qb.insertBatch('create_test', data);
48
+		expect(promise).toEqual(expect.anything());
53 49
 	});
54 50
 	afterAll(() => {
55 51
 		qb.end();

+ 10
- 14
test/adapters/mysql2_test.js View File

@@ -1,11 +1,7 @@
1
-/* eslint-env node, mocha */
2
-'use strict';
3
-
4 1
 // Load the test base
5 2
 const reload = require('require-reload')(require);
6 3
 reload.emptyCache();
7 4
 const testBase = reload('../base');
8
-const expect = testBase.expect;
9 5
 const testRunner = testBase.promiseTestRunner;
10 6
 
11 7
 // Load the test config file
@@ -24,24 +20,23 @@ describe('Mysql2 adapter tests -', () => {
24 20
 	});
25 21
 
26 22
 	it('nodeQuery.getQuery = nodeQuery.init', () => {
27
-		expect(nodeQuery.getQuery())
28
-			.to.be.deep.equal(qb);
23
+		expect(nodeQuery.getQuery()).toEqual(qb);
29 24
 	});
30 25
 
31 26
 	testRunner(qb);
32
-	it('Promise - Select with function and argument in WHERE clause', () => {
33
-		let promise = qb.select('id')
27
+	it('Promise - Select with function and argument in WHERE clause', async () => {
28
+		let promise = await qb.select('id')
34 29
 			.from('create_test')
35 30
 			.where('id', 'CEILING(SQRT(88))')
36 31
 			.get();
37 32
 
38
-		return expect(promise).to.be.fulfilled;
33
+		expect(promise).toEqual(expect.anything());
39 34
 	});
40
-	it('Test Truncate', () => {
41
-		let promise = qb.truncate('create_test');
42
-		return expect(promise).to.be.fullfilled;
35
+	it('Test Truncate', async () => {
36
+		let promise = await qb.truncate('create_test');
37
+		expect(promise).toEqual(expect.anything());
43 38
 	});
44
-	it('Test Insert Batch', () => {
39
+	it('Test Insert Batch', async () => {
45 40
 		let data = [
46 41
 			{
47 42
 				id: 5442,
@@ -58,7 +53,8 @@ describe('Mysql2 adapter tests -', () => {
58 53
 			}
59 54
 		];
60 55
 
61
-		return expect(qb.insertBatch('create_test', data)).to.be.fulfilled;
56
+		const promise = await qb.insertBatch('create_test', data);
57
+		expect(promise).toEqual(expect.anything());
62 58
 	});
63 59
 
64 60
 	/* describeTeardown(() => {

+ 0
- 38
test/adapters/node-firebird_test.js View File

@@ -1,38 +0,0 @@
1
-/* eslint-env node, mocha */
2
-'use strict';
3
-
4
-// Load the test base
5
-const path = require('path');
6
-const reload = require('require-reload')(require);
7
-const testBase = reload('../base');
8
-const expect = testBase.expect;
9
-const testRunner = testBase.promiseTestRunner;
10
-
11
-// Skip on CI
12
-if (!(process.env.CI || process.env.TRAVIS)) {
13
-	// Load the test config file
14
-	let adapterName = 'node-firebird';
15
-	const config = reload('../config.json')[adapterName];
16
-	config.connection.database = path.join(__dirname, config.connection.database);
17
-	let nodeQuery = reload('../../lib/NodeQuery')(config);
18
-
19
-	let qb = nodeQuery.getQuery();
20
-
21
-	describe('Firebird adapter tests -', () => {
22
-		it('nodeQuery.getQuery = nodeQuery.init', () => {
23
-			expect(nodeQuery.getQuery())
24
-				.to.be.deep.equal(qb);
25
-		});
26
-		it('insertBatch throws error', () => {
27
-			expect(() => {
28
-				qb.driver.insertBatch('create_test', []);
29
-			}).to.throw(Error, 'Not Implemented');
30
-		});
31
-
32
-		testRunner(qb);
33
-
34
-		afterAll(() => {
35
-			qb.end();
36
-		});
37
-	});
38
-}

+ 12
- 17
test/adapters/pg_test.js View File

@@ -1,11 +1,7 @@
1
-/* eslint-env node, mocha */
2
-'use strict';
3
-
4 1
 // Load the test base
5 2
 const reload = require('require-reload')(require);
6 3
 reload.emptyCache();
7 4
 const testBase = reload('../base');
8
-const expect = testBase.expect;
9 5
 const testRunner = testBase.promiseTestRunner;
10 6
 
11 7
 // Load the test config file
@@ -27,7 +23,7 @@ describe('Pg adapter tests -', () => {
27 23
 
28 24
 	it('nodeQuery.getQuery = nodeQuery.init', () => {
29 25
 		expect(nodeQuery.getQuery())
30
-			.to.be.deep.equal(qb);
26
+			.toEqual(qb);
31 27
 	});
32 28
 
33 29
 	it('Connecting with an object also works', () => {
@@ -35,7 +31,7 @@ describe('Pg adapter tests -', () => {
35 31
 		let nodeQuery = reload('../../lib/NodeQuery')(config);
36 32
 		qb2 = nodeQuery.getQuery();
37 33
 
38
-		expect(qb2).to.be.ok;
34
+		expect(qb2).toEqual(expect.anything());
39 35
 	});
40 36
 
41 37
 	it('Test Connection Error', done => {
@@ -43,26 +39,25 @@ describe('Pg adapter tests -', () => {
43 39
 			reload('../../lib/NodeQuery')({});
44 40
 			done(true);
45 41
 		} catch (e) {
46
-			expect(e).to.be.ok;
47
-			expect(e).is.an('Error');
42
+			expect(e).toEqual(expect.anything());
48 43
 			done();
49 44
 		}
50 45
 	});
51 46
 
52 47
 	testRunner(qb);
53
-	it('Promise - Select with function and argument in WHERE clause', () => {
54
-		let promise = qb.select('id')
48
+	it('Promise - Select with function and argument in WHERE clause', async () => {
49
+		let promise = await qb.select('id')
55 50
 			.from('create_test')
56 51
 			.where('id', 'CEILING(SQRT(88))')
57 52
 			.get();
58 53
 
59
-		return expect(promise).to.be.fulfilled;
54
+		expect(promise).toEqual(expect.anything());
60 55
 	});
61
-	it('Promise - Test Truncate', () => {
62
-		let promise = qb.truncate('create_test');
63
-		return expect(promise).to.be.fulfilled;
56
+	it('Promise - Test Truncate', async () => {
57
+		let promise = await qb.truncate('create_test');
58
+		expect(promise).toEqual(expect.anything());
64 59
 	});
65
-	it('Promise - Test Insert Batch', () => {
60
+	it('Promise - Test Insert Batch', async () => {
66 61
 		let data = [
67 62
 			{
68 63
 				id: 544,
@@ -79,8 +74,8 @@ describe('Pg adapter tests -', () => {
79 74
 			}
80 75
 		];
81 76
 
82
-		let promise = qb.insertBatch('create_test', data);
83
-		return expect(promise).to.be.fulfilled;
77
+		let promise = await qb.insertBatch('create_test', data);
78
+		expect(promise).toEqual(expect.anything());
84 79
 	});
85 80
 	afterAll(() => {
86 81
 		qb.end();

+ 6
- 10
test/adapters/sqlite3_test.js View File

@@ -1,11 +1,7 @@
1
-/* eslint-env node, mocha */
2
-'use strict';
3
-
4 1
 // Load the test base
5 2
 const reload = require('require-reload')(require);
6 3
 reload.emptyCache();
7 4
 const testBase = reload('../base');
8
-const expect = testBase.expect;
9 5
 const testRunner = testBase.promiseTestRunner;
10 6
 
11 7
 // Load the test config file
@@ -24,15 +20,15 @@ describe('Sqlite3 adapter tests -', () => {
24 20
 	});
25 21
 
26 22
 	testRunner(qb);
27
-	it('Promise - Select with function and argument in WHERE clause', () => {
28
-		let promise = qb.select('id')
23
+	it('Promise - Select with function and argument in WHERE clause', async () => {
24
+		let promise = await qb.select('id')
29 25
 			.from('create_test')
30 26
 			.where('id', 'ABS(-88)')
31 27
 			.get();
32 28
 
33
-		expect(promise).to.be.fulfilled;
29
+		expect(promise).toEqual(expect.anything());
34 30
 	});
35
-	it('Promise - Test Insert Batch', () => {
31
+	it('Promise - Test Insert Batch', async () => {
36 32
 		let data = [
37 33
 			{
38 34
 				id: 544,
@@ -49,8 +45,8 @@ describe('Sqlite3 adapter tests -', () => {
49 45
 			}
50 46
 		];
51 47
 
52
-		let promise = qb.insertBatch('create_test', data);
53
-		expect(promise).to.be.fulfilled;
48
+		let promise = await qb.insertBatch('create_test', data);
49
+		expect(promise).toEqual(expect.anything());
54 50
 	});
55 51
 	afterAll(() => {
56 52
 		qb.end();

+ 0
- 2
test/base.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 const chai = require('chai');
4 2
 const chaiAsPromised = require('chai-as-promised');
5 3
 chai.use(chaiAsPromised);

+ 43
- 51
test/base/adapterPromiseTestRunner.js View File

@@ -1,18 +1,10 @@
1
-/* eslint-env node, mocha */
2
-'use strict';
3
-
4 1
 // Load the test base
5
-const chai = require('chai');
6
-const chaiAsPromised = require('chai-as-promised');
7
-chai.use(chaiAsPromised);
8
-const expect = chai.expect;
9
-
10 2
 const reload = require('require-reload')(require);
11 3
 const tests = reload('../base/tests');
12 4
 
13 5
 module.exports = function promiseTestRunner (qb) {
14 6
 	Object.keys(tests).forEach(describeName => {
15
-		describe(describeName, () => {
7
+		describe(describeName, async () => {
16 8
 			let currentSuite = tests[describeName];
17 9
 			Object.keys(currentSuite).forEach(testDesc => {
18 10
 				it(testDesc, done => {
@@ -34,94 +26,94 @@ module.exports = function promiseTestRunner (qb) {
34 26
 						}
35 27
 					});
36 28
 
37
-					let promise = results.pop();
29
+					const promise = results.pop();
38 30
 					promise.then(result => {
39
-						expect(result.rows).is.an('array');
40
-						expect(result.rowCount()).to.not.be.undefined;
41
-						expect(result.columnCount()).to.not.be.undefined;
31
+						// expect(result.rows).is.an('array');
32
+						expect(result.rowCount()).toEqual(expect.anything());
33
+						expect(result.columnCount()).toEqual(expect.anything());
42 34
 						return done();
43 35
 					}).catch(e => done(e));
44 36
 				});
45 37
 			});
46 38
 		});
47 39
 	});
48
-	describe('DB update tests -', () => {
40
+	describe('DB update tests -', async () => {
49 41
 		beforeAll(done => {
50 42
 			let sql = qb.driver.truncate('create_test');
51 43
 			qb.query(sql).then(res => done())
52 44
 				.catch(err => done(err));
53 45
 		});
54
-		it('Promise - Test Insert', () => {
55
-			let promise = qb.set('id', 98)
46
+		it('Promise - Test Insert', async () => {
47
+			const promise = await qb.set('id', 98)
56 48
 				.set('key', '84')
57 49
 				.set('val', Buffer.from('120'))
58 50
 				.insert('create_test');
59 51
 
60
-			return expect(promise).to.be.fulfilled;
52
+			expect(promise).toEqual(expect.anything());
61 53
 		});
62
-		it('Promise - Test Insert Object', () => {
63
-			let promise = qb.insert('create_test', {
54
+		it('Promise - Test Insert Object', async () => {
55
+			const promise = await qb.insert('create_test', {
64 56
 				id: 587,
65 57
 				key: 1,
66 58
 				val: Buffer.from('2')
67 59
 			});
68 60
 
69
-			return expect(promise).to.be.fulfilled;
61
+			expect(promise).toEqual(expect.anything());
70 62
 		});
71
-		it('Promise - Test Update', () => {
72
-			let promise = qb.where('id', 7)
63
+		it('Promise - Test Update', async () => {
64
+			const promise = await qb.where('id', 7)
73 65
 				.update('create_test', {
74 66
 					id: 7,
75 67
 					key: 'gogle',
76 68
 					val: Buffer.from('non-word')
77 69
 				});
78 70
 
79
-			return expect(promise).to.be.fulfilled;
71
+			expect(promise).toEqual(expect.anything());
80 72
 		});
81
-		it('Promise - Test set Array Update', () => {
73
+		it('Promise - Test set Array Update', async () => {
82 74
 			let object = {
83 75
 				id: 22,
84 76
 				key: 'gogle',
85 77
 				val: Buffer.from('non-word')
86 78
 			};
87 79
 
88
-			let promise = qb.set(object)
80
+			const promise = await qb.set(object)
89 81
 				.where('id', 22)
90 82
 				.update('create_test');
91 83
 
92
-			return expect(promise).to.be.fulfilled;
84
+			expect(promise).toEqual(expect.anything());
93 85
 		});
94
-		it('Promise - Test where set update', () => {
95
-			let promise = qb.where('id', 36)
86
+		it('Promise - Test where set update', async () => {
87
+			const promise = await qb.where('id', 36)
96 88
 				.set('id', 36)
97 89
 				.set('key', 'gogle')
98 90
 				.set('val', Buffer.from('non-word'))
99 91
 				.update('create_test');
100 92
 
101
-			return expect(promise).to.be.fulfilled;
93
+			expect(promise).toEqual(expect.anything());
102 94
 		});
103
-		it('Promise - Test delete', () => {
104
-			let promise = qb.delete('create_test', {id: 5});
105
-			return expect(promise).to.be.fulfilled;
95
+		it('Promise - Test delete', async () => {
96
+			const promise = await qb.delete('create_test', {id: 5});
97
+			expect(promise).toEqual(expect.anything());
106 98
 		});
107
-		it('Promise - Delete with where', () => {
108
-			let promise = qb.where('id', 5)
99
+		it('Promise - Delete with where', async () => {
100
+			const promise = await qb.where('id', 5)
109 101
 				.delete('create_test');
110 102
 
111
-			return expect(promise).to.be.fulfilled;
103
+			expect(promise).toEqual(expect.anything());
112 104
 		});
113
-		it('Promise - Delete multiple where values', () => {
114
-			let promise = qb.delete('create_test', {
105
+		it('Promise - Delete multiple where values', async () => {
106
+			const promise = await qb.delete('create_test', {
115 107
 				id: 5,
116 108
 				key: 'gogle'
117 109
 			});
118 110
 
119
-			return expect(promise).to.be.fulfilled;
111
+			expect(promise).toEqual(expect.anything());
120 112
 		});
121 113
 	});
122
-	describe('Grouping tests -', () => {
123
-		it('Promise - Using grouping method', () => {
124
-			let promise = qb.select('id, key as k, val')
114
+	describe('Grouping tests -', async () => {
115
+		it('Promise - Using grouping method', async () => {
116
+			const promise = await qb.select('id, key as k, val')
125 117
 				.from('create_test')
126 118
 				.groupStart()
127 119
 				.where('id >', 1)
@@ -130,10 +122,10 @@ module.exports = function promiseTestRunner (qb) {
130 122
 				.limit(2, 1)
131 123
 				.get();
132 124
 
133
-			return expect(promise).to.be.fulfilled;
125
+			expect(promise).toEqual(expect.anything());
134 126
 		});
135
-		it('Promise - Using where first grouping', () => {
136
-			let promise = qb.select('id, key as k, val')
127
+		it('Promise - Using where first grouping', async () => {
128
+			const promise = await qb.select('id, key as k, val')
137 129
 				.from('create_test')
138 130
 				.where('id !=', 5)
139 131
 				.groupStart()
@@ -143,10 +135,10 @@ module.exports = function promiseTestRunner (qb) {
143 135
 				.limit(2, 1)
144 136
 				.get();
145 137
 
146
-			return expect(promise).to.be.fulfilled;
138
+			expect(promise).toEqual(expect.anything());
147 139
 		});
148
-		it('Promise - Using or grouping method', () => {
149
-			let promise = qb.select('id, key as k, val')
140
+		it('Promise - Using or grouping method', async () => {
141
+			const promise = await qb.select('id, key as k, val')
150 142
 				.from('create_test')
151 143
 				.groupStart()
152 144
 				.where('id >', 1)
@@ -158,10 +150,10 @@ module.exports = function promiseTestRunner (qb) {
158 150
 				.limit(2, 1)
159 151
 				.get();
160 152
 
161
-			return expect(promise).to.be.fulfilled;
153
+			expect(promise).toEqual(expect.anything());
162 154
 		});
163
-		it('Promise - Using or not grouping method', () => {
164
-			let promise = qb.select('id, key as k, val')
155
+		it('Promise - Using or not grouping method', async () => {
156
+			const promise = await qb.select('id, key as k, val')
165 157
 				.from('create_test')
166 158
 				.groupStart()
167 159
 				.where('id >', 1)
@@ -173,7 +165,7 @@ module.exports = function promiseTestRunner (qb) {
173 165
 				.limit(2, 1)
174 166
 				.get();
175 167
 
176
-			return expect(promise).to.be.fulfilled;
168
+			expect(promise).toEqual(expect.anything());
177 169
 		});
178 170
 	});
179 171
 };

+ 0
- 2
test/base/tests.js View File

@@ -1,5 +1,3 @@
1
-'use strict';
2
-
3 1
 module.exports = {
4 2
 	'Get tests -': {
5 3
 		'Get with function': {

+ 5
- 9
test/base_test.js View File

@@ -1,7 +1,3 @@
1
-/* eslint-env node, mocha */
2
-'use strict';
3
-
4
-const expect = require('chai').expect;
5 1
 const reload = require('require-reload')(require);
6 2
 const glob = require('glob');
7 3
 const nodeQuery = reload('../lib/NodeQuery')();
@@ -14,7 +10,7 @@ describe('Base tests -', () => {
14 10
 			let obj = require(mod);
15 11
 			let shortName = mod.replace(/^\/(.*?)\/lib\/(.*?)\.js$/g, '$2');
16 12
 			it(`${shortName} module is sane`, () => {
17
-				expect(obj).to.be.ok;
13
+				expect(obj).toEqual(expect.anything());
18 14
 			});
19 15
 		});
20 16
 	});
@@ -26,7 +22,7 @@ describe('Base tests -', () => {
26 22
 		nodeQueryCopy.instance = null;
27 23
 		expect(() => {
28 24
 			nodeQueryCopy.getQuery();
29
-		}).to.throw(Error, 'No Query Builder instance to return');
25
+		}).toThrow(Error, 'No Query Builder instance to return');
30 26
 	});
31 27
 
32 28
 	it('Invalid driver type', () => {
@@ -34,20 +30,20 @@ describe('Base tests -', () => {
34 30
 			reload('../lib/NodeQuery')({
35 31
 				driver: 'Foo'
36 32
 			});
37
-		}).to.throw(Error, 'Selected driver (Foo) does not exist!');
33
+		}).toThrow(Error, 'Selected driver (Foo) does not exist!');
38 34
 	});
39 35
 
40 36
 	it('Invalid adapter', () => {
41 37
 		expect(() => {
42 38
 			let a = new Adapter();
43 39
 			a.execute();
44
-		}).to.throw(Error, 'Correct adapter not defined for query execution');
40
+		}).toThrow(Error, 'Correct adapter not defined for query execution');
45 41
 	});
46 42
 
47 43
 	it('Invalid adapter - missing transformResult', () => {
48 44
 		expect(() => {
49 45
 			let a = new Adapter();
50 46
 			a.transformResult([]);
51
-		}).to.throw(Error, 'Result transformer method not defined for current adapter');
47
+		}).toThrow(Error, 'Result transformer method not defined for current adapter');
52 48
 	});
53 49
 });

+ 21
- 28
test/helpers_test.js View File

@@ -1,26 +1,19 @@
1
-/* eslint-env node, mocha */
2
-'use strict';
3
-
4
-const chai = require('chai');
5
-const assert = chai.assert;
6
-const expect = chai.expect;
7
-
8
-let Helpers = require('../lib/Helpers');
1
+const Helpers = require('../lib/Helpers');
9 2
 
10 3
 describe('Helper Module Tests -', () => {
11 4
 	describe('Type-checking methods -', () => {
12 5
 		describe('Object wrappers are listed as their native type', () => {
13 6
 			it('Boolean Wrapper returns \'boolean\' not \'object\'', () => {
14 7
 				let item = Boolean(true);
15
-				expect(Helpers.type(item)).to.deep.equal('boolean');
8
+				expect(Helpers.type(item)).toEqual('boolean');
16 9
 			});
17 10
 			it('Number Wrapper returns \'number\' not \'object\'', () => {
18 11
 				let item = Number(4867);
19
-				expect(Helpers.type(item)).to.deep.equal('number');
12
+				expect(Helpers.type(item)).toEqual('number');
20 13
 			});
21 14
 			it('String Wrapper returns \'string\' not \'object\'', () => {
22 15
 				let item = String('Foo');
23
-				expect(Helpers.type(item)).to.deep.equal('string');
16
+				expect(Helpers.type(item)).toEqual('string');
24 17
 			});
25 18
 		});
26 19
 		describe('is..Method methods exist -', () => {
@@ -40,7 +33,7 @@ describe('Helper Module Tests -', () => {
40 33
 
41 34
 			types.forEach(type => {
42 35
 				it(`is${type} method exists`, () => {
43
-					assert.ok(Helpers[`is${type}`]);
36
+					expect(Helpers[`is${type}`]).toBeDefined();
44 37
 				});
45 38
 			});
46 39
 		});
@@ -52,7 +45,7 @@ describe('Helper Module Tests -', () => {
52 45
 			};
53 46
 			Object.keys(trueCases).forEach(desc => {
54 47
 				it(desc, () => {
55
-					expect(Helpers.isScalar(trueCases[desc])).to.be.true;
48
+					expect(Helpers.isScalar(trueCases[desc])).toBe(true);
56 49
 				});
57 50
 			});
58 51
 
@@ -62,24 +55,24 @@ describe('Helper Module Tests -', () => {
62 55
 			};
63 56
 			Object.keys(falseCases).forEach(desc => {
64 57
 				it(desc, () => {
65
-					expect(Helpers.isScalar(falseCases[desc])).to.be.false;
58
+					expect(Helpers.isScalar(falseCases[desc])).toBe(false);
66 59
 				});
67 60
 			});
68 61
 		});
69 62
 		describe('isInfinity -', () => {
70 63
 			it('The type of 1/0 is infinity', () => {
71
-				expect(Helpers.type(1 / 0)).to.equal('infinity');
64
+				expect(Helpers.type(1 / 0)).toBe('infinity');
72 65
 			});
73 66
 			it('isInfinity is the same as isInfinite', () => {
74
-				expect(Helpers.isInfinite(1 / 0)).to.be.true;
67
+				expect(Helpers.isInfinite(1 / 0)).toBe(true);
75 68
 			});
76 69
 		});
77 70
 		describe('isNaN -', () => {
78 71
 			it('The type of 0 / 0 is NaN', () => {
79
-				expect(Helpers.type(0 / 0)).to.equal('nan');
72
+				expect(Helpers.type(0 / 0)).toBe('nan');
80 73
 			});
81 74
 			it('isNaN method agrees with type', () => {
82
-				expect(Helpers.isNaN(0 / 0)).to.be.true;
75
+				expect(Helpers.isNaN(0 / 0)).toBe(true);
83 76
 			});
84 77
 		});
85 78
 	});
@@ -89,7 +82,7 @@ describe('Helper Module Tests -', () => {
89 82
 				let orig = ['  x y ', 'z   ', ' q'];
90 83
 				let ret = ['x y', 'z', 'q'];
91 84
 
92
-				expect(orig.map(Helpers.stringTrim)).to.be.deep.equal(ret);
85
+				expect(orig.map(Helpers.stringTrim)).toEqual(ret);
93 86
 			});
94 87
 		});
95 88
 		describe('arrayPluck -', () => {
@@ -106,13 +99,13 @@ describe('Helper Module Tests -', () => {
106 99
 			];
107 100
 
108 101
 			it('Finding members in all objects', () => {
109
-				expect(Helpers.arrayPluck(orig, 'foo')).to.be.deep.equal([1, 2, 3]);
102
+				expect(Helpers.arrayPluck(orig, 'foo')).toEqual([1, 2, 3]);
110 103
 			});
111 104
 			it('Some members are missing in some objects', () => {
112
-				expect(Helpers.arrayPluck(orig, 'bar')).to.be.deep.equal([10, 15]);
105
+				expect(Helpers.arrayPluck(orig, 'bar')).toEqual([10, 15]);
113 106
 			});
114 107
 			it('Empty case', () => {
115
-				expect(Helpers.arrayPluck([], 'apple')).to.be.deep.equal([]);
108
+				expect(Helpers.arrayPluck([], 'apple')).toEqual([]);
116 109
 			});
117 110
 		});
118 111
 		describe('regexInArray -', () => {
@@ -133,25 +126,25 @@ describe('Helper Module Tests -', () => {
133 126
 				Object.keys(boolCase).forEach(desc => {
134 127
 					it(desc, () => {
135 128
 						if (i) {
136
-							expect(Helpers.regexInArray(orig, boolCase[desc])).to.be.true;
129
+							expect(Helpers.regexInArray(orig, boolCase[desc])).toBe(true);
137 130
 						} else {
138
-							expect(Helpers.regexInArray(orig, boolCase[desc])).to.be.false;
131
+							expect(Helpers.regexInArray(orig, boolCase[desc])).toBe(false);
139 132
 						}
140 133
 					});
141 134
 				});
142 135
 			});
143 136
 
144 137
 			it('First argument is not an array', () => {
145
-				expect(Helpers.regexInArray(5, /5/)).to.be.false;
138
+				expect(Helpers.regexInArray(5, /5/)).toBe(false);
146 139
 			});
147 140
 			it('Array is empty', () => {
148
-				expect(Helpers.regexInArray([], /.*/)).to.be.false;
141
+				expect(Helpers.regexInArray([], /.*/)).toBe(false);
149 142
 			});
150 143
 		});
151 144
 		describe('upperCaseFirst -', () => {
152 145
 			it('Capitalizes only the first letter of the string', () => {
153
-				expect(Helpers.upperCaseFirst('foobar')).to.equal('Foobar');
154
-				expect(Helpers.upperCaseFirst('FOOBAR')).to.equal('FOOBAR');
146
+				expect(Helpers.upperCaseFirst('foobar')).toBe('Foobar');
147
+				expect(Helpers.upperCaseFirst('FOOBAR')).toBe('FOOBAR');
155 148
 			});
156 149
 		});
157 150
 	});

+ 11
- 15
test/query-parser_test.js View File

@@ -1,7 +1,3 @@
1
-/* eslint-env node, mocha */
2
-'use strict';
3
-const expect = require('chai').expect;
4
-
5 1
 // Use the base driver as a mock for testing
6 2
 const Helpers = require('../lib/Helpers');
7 3
 const driver = require('../lib/Driver');
@@ -56,11 +52,11 @@ describe('Query Parser Tests', () => {
56 52
 	describe('Has operator tests', () => {
57 53
 		it('Has operator', () => {
58 54
 			let matches = parser.hasOperator('foo <> 2');
59
-			expect(matches).to.be.deep.equal(['<>']);
55
+			expect(matches).toEqual(['<>']);
60 56
 		});
61 57
 		it('Has no operator', () => {
62 58
 			let matches = parser.hasOperator('foo');
63
-			expect(matches).to.be.null;
59
+			expect(matches).toBe(null);
64 60
 		});
65 61
 	});
66 62
 	describe('Where parser tests', () => {
@@ -71,13 +67,13 @@ describe('Query Parser Tests', () => {
71 67
 			whereMock('time < SUM(FOO(BAR()))');
72 68
 			parser.parseWhere(driver, state);
73 69
 			expect(state.whereMap)
74
-				.to.be.deep.equal(['"time" < SUM(FOO(BAR()))']);
70
+				.toEqual(['"time" < SUM(FOO(BAR()))']);
75 71
 		});
76 72
 		it('Has function key/val', () => {
77 73
 			whereMock('time <', 'SUM(FOO(BAR()))');
78 74
 			parser.parseWhere(driver, state);
79 75
 			expect(state.whereMap)
80
-				.to.be.deep.equal(['"time" < SUM(FOO(BAR()))']);
76
+				.toEqual(['"time" < SUM(FOO(BAR()))']);
81 77
 		});
82 78
 		it('Has function key/val object', () => {
83 79
 			whereMock({
@@ -85,7 +81,7 @@ describe('Query Parser Tests', () => {
85 81
 			});
86 82
 			parser.parseWhere(driver, state);
87 83
 			expect(state.whereMap)
88
-				.to.be.deep.equal(['"time" < SUM(FOO(BAR(\'x\')))']);
84
+				.toEqual(['"time" < SUM(FOO(BAR(\'x\')))']);
89 85
 		});
90 86
 		it('Has literal value', () => {
91 87
 			whereMock({
@@ -93,9 +89,9 @@ describe('Query Parser Tests', () => {
93 89
 			});
94 90
 			parser.parseWhere(driver, state);
95 91
 			expect(state.whereMap)
96
-				.to.be.deep.equal(['"foo" = ?']);
92
+				.toEqual(['"foo" = ?']);
97 93
 			expect(state.whereValues)
98
-				.to.be.deep.equal(['3']);
94
+				.toEqual(['3']);
99 95
 		});
100 96
 		it('Has multiple literal values', () => {
101 97
 			whereMock({
@@ -104,9 +100,9 @@ describe('Query Parser Tests', () => {
104 100
 			});
105 101
 			parser.parseWhere(driver, state);
106 102
 			expect(state.whereMap)
107
-				.to.be.deep.equal(['"foo" = ?', '"bar" = ?']);
103
+				.toEqual(['"foo" = ?', '"bar" = ?']);
108 104
 			expect(state.whereValues)
109
-				.to.be.deep.equal(['3', '5']);
105
+				.toEqual(['3', '5']);
110 106
 		});
111 107
 	});
112 108
 	describe('Parse join tests', () => {
@@ -133,7 +129,7 @@ describe('Query Parser Tests', () => {
133 129
 		data.forEach(datum => {
134 130
 			it(datum.desc, () => {
135 131
 				let matches = parser.parseJoin(datum.join);
136
-				expect(matches.combined).to.be.deep.equal(datum.expected);
132
+				expect(matches.combined).toEqual(datum.expected);
137 133
 			});
138 134
 		});
139 135
 	});
@@ -161,7 +157,7 @@ describe('Query Parser Tests', () => {
161 157
 		data.forEach(datum => {
162 158
 			it(datum.desc, () => {
163 159
 				let join = parser.compileJoin(datum.clause);
164
-				expect(join).to.be.deep.equal(datum.expected);
160
+				expect(join).toEqual(datum.expected);
165 161
 			});
166 162
 		});
167 163
 	});

Loading…
Cancel
Save