Skip to content

Commit

Permalink
Moved case insensitive search in sqlite to its own test case
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammedbalila committed Apr 4, 2024
1 parent e98edcb commit b58d757
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions test/integration2/query/select/where.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,15 +637,22 @@ describe('Where', function () {
expect(result[7].email).to.equal('test8@example.com');
});

it("doesn't find data using whereLike when different case sensitivity", async () => {
it("doesn't find data using whereLike when different case sensitivity", async function () {
const result = await knex('accounts').whereLike('email', 'Test1%');
// sqlite only supports case-insensitive search
if (isSQLite(knex)) {
expect(result.length).to.equal(1);
expect(result[0].email).to.equal('test1@example.com');
} else {
expect(result).to.deep.equal([]);
this.skip();
}
expect(result).to.deep.equal([]);
});

it('supports only case-insensitive searches in sqlite', async function () {
const result = await knex('accounts').whereILike('email', 'Test1%');
if (!isSQLite(knex)) {
this.skip();
}
expect(result.length).to.equal(1);
expect(result[0].email).to.equal('test1@example.com');
});
});

Expand Down

0 comments on commit b58d757

Please sign in to comment.