Skip to content

Commit

Permalink
Fixing test to ONLY run on sqlite3
Browse files Browse the repository at this point in the history
  • Loading branch information
code-ape committed Dec 30, 2023
1 parent 3cba457 commit 5a5251e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 5 additions & 4 deletions test/integration2/query/insert/inserts.spec.js
Expand Up @@ -14,6 +14,7 @@ const {
isRedshift,
isPostgreSQL,
isSQLite,
isSQLite3,
isMssql,
isMysql,
isOracle,
Expand Down Expand Up @@ -2315,9 +2316,9 @@ describe('Inserts', function () {
});
});

describe(`#5769 sqlite multi-insert uses standard syntax and supports JSON`, function () {
describe(`#5769 sqlite multi-insert uses standard syntax and supports JSON (does NOT include better-sqlite3)`, function () {
it(`should JSON.stringify Sqlite multi-insert of Objects`, async function () {
if (!isSQLite(knex)) {
if (!isSQLite3(knex)) {
return this.skip();
}

Expand All @@ -2334,7 +2335,7 @@ describe('Inserts', function () {
});

it(`should throw error if doing Sqlite multi-insert on pre-3.7.11 version`, async function () {
if (!isSQLite(knex)) {
if (!isSQLite3(knex)) {
return this.skip();
}

Expand All @@ -2356,7 +2357,7 @@ describe('Inserts', function () {
});

it(`should NOT throw error if doing Sqlite multi-insert on 3.7.11 version`, async function () {
if (!isSQLite(knex)) {
if (!isSQLite3(knex)) {
return this.skip();
}

Expand Down
8 changes: 7 additions & 1 deletion test/util/db-helpers.js
Expand Up @@ -51,8 +51,13 @@ function isRedshift(knex) {
return getDriverName(knex) === drivers.Redshift;
}

/** Checks for ONLY the sqlite3 client and NOT better-sqlite3 */
function isSQLite3(knex) {
return getDriverName(knex) === drivers.SQLite;
}

function isSQLite(knex) {
return getDriverName(knex) === drivers.SQLite || isBetterSQLite3(knex);
return isSQLite3(knex) || isBetterSQLite3(knex);
}

function isCockroachDB(knex) {
Expand Down Expand Up @@ -86,5 +91,6 @@ module.exports = {
isPgBasedDriverName,
isRedshift,
isSQLite,
isSQLite3,
isBetterSQLite3,
};

0 comments on commit 5a5251e

Please sign in to comment.