forked from CodebuffAI/codebuff
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-bigquery-mocks.ts
More file actions
26 lines (22 loc) · 981 Bytes
/
Copy pathsetup-bigquery-mocks.ts
File metadata and controls
26 lines (22 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { beforeEach, spyOn } from 'bun:test'
import * as bigquery from '@codebuff/bigquery'
const applyBigQueryMocks = () => {
spyOn(bigquery, 'setupBigQuery').mockImplementation(async () => {})
spyOn(bigquery, 'insertMessageBigquery').mockImplementation(async () => true)
spyOn(bigquery, 'insertTrace').mockImplementation(async () => true)
spyOn(bigquery, 'insertRelabel').mockImplementation(async () => true)
spyOn(bigquery, 'getRecentTraces').mockImplementation(async () => [])
spyOn(bigquery, 'getRecentRelabels').mockImplementation(async () => [])
spyOn(bigquery, 'getTracesWithoutRelabels').mockImplementation(async () => [])
spyOn(bigquery, 'getTracesWithRelabels').mockImplementation(async () => [])
spyOn(bigquery, 'getTracesAndRelabelsForUser').mockImplementation(
async () => [],
)
spyOn(bigquery, 'getTracesAndAllDataForUser').mockImplementation(
async () => [],
)
}
applyBigQueryMocks()
beforeEach(() => {
applyBigQueryMocks()
})