mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-06-01 12:45:59 -04:00
Fix jest tests
This commit is contained in:
@@ -153,7 +153,7 @@ const EXCLUDED_PROFILE_COLS = new Set(['search_text', 'search_tsv'])
|
||||
|
||||
let profileCols: any
|
||||
|
||||
const getProfileCols = async () => {
|
||||
export const getProfileCols = async () => {
|
||||
if (profileCols) return profileCols
|
||||
const pg = createSupabaseDirectClient()
|
||||
const rows = await pg.manyOrNone<{column_name: string}>(
|
||||
|
||||
@@ -6,6 +6,7 @@ import * as sqlBuilder from 'shared/supabase/sql-builder'
|
||||
describe('getProfiles', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks()
|
||||
jest.spyOn(profilesModule, 'getProfileCols').mockResolvedValue(null)
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
@@ -77,6 +78,7 @@ describe('loadProfiles', () => {
|
||||
}
|
||||
|
||||
jest.spyOn(supabaseInit, 'createSupabaseDirectClient').mockReturnValue(mockPg)
|
||||
jest.spyOn(profilesModule, 'getProfileCols').mockResolvedValue(null)
|
||||
})
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks()
|
||||
|
||||
Reference in New Issue
Block a user