Skip to content

Commit

Permalink
test: add test case for raw query
Browse files Browse the repository at this point in the history
  • Loading branch information
kiddyuchina committed Aug 6, 2024
1 parent 3efc263 commit 83f7703
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
@@ -718,7 +718,16 @@ describe('Integration test', () => {

afterAll(() => {
connection.destroy();
})
});

describe('raw', () => {
it('should execute raw SQL query and return correct result', async () => {
const user = await connection.raw('SELECT id FROM users WHERE id > ? LIMIT 1', [1]);
expect(user).toEqual([{
id: 2
}]);
});
});

describe('Model', () => {
it('should return a same instance', () => {

0 comments on commit 83f7703

Please sign in to comment.