Skip to content

Commit

Permalink
fixng snowflake test case
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal committed Nov 21, 2024
1 parent 49991af commit 4ebb763
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/connections/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,19 @@ describe('Database Connection', () => {

const sql =
process.env.CONNECTION_TYPE === 'mysql'
? 'SELECT CONCAT(:hello, :world) AS TESTING_WORD'
: 'SELECT (:hello || :world) AS TESTING_WORD';
? 'SELECT CONCAT(:hello, :world) AS testing_word'
: 'SELECT (:hello || :world) AS testing_word';

const { data } = await db.raw(sql, {
hello: 'hello ',
world: 'world',
});

expect(data).toEqual([{ TESTING_WORD: 'hello world' }]);
if (process.env.CONNECTION_TYPE === 'snowflake') {
expect(data).toEqual([{ TESTING_WORD: 'hello world' }]);
} else {
expect(data).toEqual([{ testing_word: 'hello world' }]);
}
});

test('Support positional placeholder', async () => {
Expand Down

0 comments on commit 4ebb763

Please sign in to comment.