UNPKG

tspace-mysql

Version:

Tspace MySQL is a promise-based ORM for Node.js, designed with modern TypeScript and providing type safety for schema databases.

26 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const chai_1 = require("chai"); const mocha_1 = require("mocha"); const lib_1 = require("../lib"); (0, mocha_1.describe)('Testing Pool', function () { /* ##################################################### */ (0, mocha_1.it)('Pool: It is connected?', async function () { (0, chai_1.expect)(lib_1.Pool).to.have.an('object'); (0, chai_1.expect)(lib_1.Pool).to.have.property('query'); (0, chai_1.expect)(lib_1.Pool).to.have.property('connection'); (0, chai_1.expect)(lib_1.Pool.connection).to.be.a('function'); (0, chai_1.expect)(lib_1.Pool.query).to.be.a('function'); const query = await lib_1.Pool.query('SELECT 1 as ping'); (0, chai_1.expect)(query).to.be.an('array'); (0, chai_1.expect)(query.length).to.be.equal(1); (0, chai_1.expect)(query[0].ping).to.be.equal(1); const connect = await lib_1.Pool.connection(); (0, chai_1.expect)(connect.query).to.be.an('function'); const connectQuery = await connect.query('SELECT 1 as ping'); (0, chai_1.expect)(connectQuery).to.be.an('array'); (0, chai_1.expect)(connectQuery[0].ping).to.be.equal(1); }); /* ###################################################### */ }); //# sourceMappingURL=01-Pool.test.js.map