Skip to content

Commit

Permalink
So, these are the real tests apparently
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpilowsky committed Dec 16, 2020
1 parent 684cfd2 commit 26f5892
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,9 @@ describe('html', () => {
expect(hlHtml("SELECT COUNT(id), `id`, `username` FROM `users` WHERE `email` = 'test@example.com' AND `foo` = 'BAR' OR 1=1"))
.toBe("<span class=\"sql-hl-keyword\">SELECT</span> <span class=\"sql-hl-function\">COUNT</span><span class=\"sql-hl-bracket\">(</span>id<span class=\"sql-hl-bracket\">)</span><span class=\"sql-hl-special\">,</span> <span class=\"sql-hl-string\">`id`</span><span class=\"sql-hl-special\">,</span> <span class=\"sql-hl-string\">`username`</span><span class=\"sql-hl-keyword\"> FROM</span> <span class=\"sql-hl-string\">`users`</span><span class=\"sql-hl-keyword\"> WHERE</span> <span class=\"sql-hl-string\">`email`</span> <span class=\"sql-hl-special\">=</span> <span class=\"sql-hl-string\">'test@example.com'</span><span class=\"sql-hl-keyword\"> AND</span> <span class=\"sql-hl-string\">`foo`</span> <span class=\"sql-hl-special\">=</span> <span class=\"sql-hl-string\">'BAR'</span><span class=\"sql-hl-keyword\"> OR</span> <span class=\"sql-hl-number\">1</span><span class=\"sql-hl-special\">=</span><span class=\"sql-hl-number\">1</span>")
})

it('query with identifiers without apostrophes', () => {
expect(hlHtml('SELECT id FROM users'))
.toBe('<span class="sql-hl-keyword">SELECT</span> id<span class="sql-hl-keyword"> FROM</span> users')
})
})

0 comments on commit 26f5892

Please sign in to comment.