Skip to content

Commit

Permalink
fix(test): update jest test
Browse files Browse the repository at this point in the history
  • Loading branch information
duyet committed Sep 25, 2024
1 parent 0cdd1de commit 4db2111
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/clickhouse-query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ import { applyInterval } from './clickhouse-query'
describe('applyInterval', () => {
it('should apply toStartOfDay for toStartOfDay interval', () => {
const result = applyInterval('toStartOfDay', 'myColumn', 'myAlias')
expect(result).toEqual('toDate(toStartOfDay(myColumn)) as myAlias') // Change to toEqual
expect(result).toEqual('toDate(toStartOfDay(myColumn)) AS myAlias') // Change to toEqual
})

it('should apply toStartOfWeek for toStartOfWeek interval', () => {
const result = applyInterval('toStartOfWeek', 'myColumn')
expect(result).toEqual('toDate(toStartOfWeek(myColumn)) as myColumn') // Change to toEqual
expect(result).toEqual('toDate(toStartOfWeek(myColumn)) AS myColumn') // Change to toEqual
})

it('should apply toStartOfMonth for toStartOfMonth interval', () => {
const result = applyInterval('toStartOfMonth', 'myColumn', 'myAlias')
expect(result).toEqual('toDate(toStartOfMonth(myColumn)) as myAlias') // Change to toEqual
expect(result).toEqual('toDate(toStartOfMonth(myColumn)) AS myAlias') // Change to toEqual
})

it('should apply toStartOfHour for other intervals', () => {
const result = applyInterval('toStartOfHour', 'myColumn', 'myAlias')
expect(result).toEqual('toStartOfHour(myColumn) as myAlias') // Change to toEqual
expect(result).toEqual('toStartOfHour(myColumn) AS myAlias') // Change to toEqual
})
})

0 comments on commit 4db2111

Please sign in to comment.